<template>
  <div class="com_comAllTypeJobs">
    <!-- <div style="display: flex;justify-content: right;padding:10px;background:white;" v-if="btnShow">
      <van-button color="#7232dd" plain round  size="small" style="margin-right: 10px;" @click="chDataRes('source')">使用源数据</van-button>
      <van-button type="danger" plain round  size="small" @click="chDataRes('save')">使用保存数据</van-button>
    </div> -->
    <van-tabs v-model="active" scrollspy sticky color="#1989fa" swipe-threshold="4">
      <van-form @submit="onSubmit" @failed="onFailed" scroll-to-error ref="formFieldBox">
        <van-tab title="基础信息">
          <div>
            <van-divider :style="{
              color: '#020202',
              borderColor: '#DD4F42',
              padding: '10px 100px 0',
              margin: '0'
            }">基础信息</van-divider>
            <van-row justify="center" v-if="!isPrivateLogin">
              <van-col span="11" style="height: 63.33px;overflow: hidden;">
                <van-field autocomplete="off">
                  <template #input>
                    <van-radio-group v-model="privateLoginType" direction="horizontal"
                      style="float: right;margin-top:5px;">
                      <van-radio v-for="item in ['公库', '私库']" :name="item" :key="item">
                        {{ item }}
                      </van-radio>
                    </van-radio-group>
                  </template>
                </van-field>
              </van-col>
              <van-col span="8" style="height: 63.33px;">
                <van-field autocomplete="off" placeholder="请输入隐私密码" v-model="privateLoginPwd" size="normal"></van-field>
              </van-col>
              <van-col span="5" style="height: 63.33px;">
                <van-button type="primary" native-type='button' size="small" @click="privateLogin"
                  style="float:left;margin-top:10px;margin-left:10px;">登录修改</van-button></van-col>
            </van-row>
            <van-row justify="center" v-if="isPrivateLogin" style="padding: 8px;">
              <van-col span="24" style="font-size: 0.38rem;text-align: center;">
                <div style="margin:10px;display: inline-block;">{{ privateLoginType }} 登录成功</div>
                <van-button type="primary" native-type='button' size="small" @click="privateLogout"
                  style="vertical-align: top;">退出登录</van-button>
              </van-col>
            </van-row>
            <!-- <van-row style="margin-bottom:8px;">
              <van-col span="24">
                <div style="font-size: 20.1598px;text-align: center;margin:0 auto;" @click="showDeleteKeyword = true;">
                  删除库维护
                </div>
              </van-col>
            </van-row> -->
            <quillEditor :jobContent='job_content' @change="costPlannedAmountChange($event)" @autoFill="autofill_handle"
              @fill_contact="fill_contact_handle">
              <template #btns v-if="btnShow">
                <van-col span="8" style="text-align: center;color:rgb(114, 50, 221)">
                  <span @click="chDataRes('source')">使用源数据</span>
                </van-col>
                <van-col span="8" style="text-align: right;color:#ee0a24">
                  <span @click="chDataRes('save')">使用保存数据</span>
                </van-col>
              </template>
            </quillEditor>
 
            <!--  发布类型  -->
            <div class="color1">
              <van-field autocomplete="off" name="job_category_id" label="发布类型">
                <template #input>
                  <van-radio-group v-model="job_category_id" direction="horizontal" style="margin-bottom: -10px">
                    <com-radio v-for="item in jobTypeList" :key-name="item.title" :key-id="item.id"
                      prop-name="job_category_id" :name="item.id" :key="item.id" style="margin-bottom: 10px;">
                      {{ item.title }}
                    </com-radio>
                  </van-radio-group>
                </template>
              </van-field>
            </div>
            <!-- <van-field
              v-model="job_content"
              rows="4"
              autosize
              label="招聘详情"
              type="textarea"
              placeholder="请输入招聘详情信息"
              show-word-limit
            /> -->
            <!-- 企业名称   -->
 
            <div class="color1">
              <van-field autocomplete="off" v-model="enterprise_name" name="enterprise_name" label="企业名称"
                placeholder="请输入企业名称(必填)" type="textarea" rows="1" autosize :rules="[
                  { required: true, message: '企业名称未填写' },
                  {
                    validator: value => {
                      return wordCountLimit(value, 500)
                    },
                    message: '企业名称长度不能超过500位'
                  }
                ]" required>
                <template #label>
                  <div @click="openShowCompanyName">企业名称</div>
                </template>
              </van-field>
            </div>
            <!-- 招聘信息  -->
            <div class="color1">
              <van-field style="align-items:center;" autocomplete="off" v-model="recruiting_position"
                name="recruiting_position" label="招聘职位" placeholder="请输入招聘职位(必填)" type="textarea" rows="1" autosize
                :rules="[
                  { required: true, message: '招聘职位未填写' },
                  {
                    validator: value => {
                      return wordCountLimit(value, 500)
                    },
                    message: '招聘职位长度不能超过500位'
                  }
                ]" required>
                <template #label>
                  <div @click="openShowPosition">招聘职位</div>
                  <!-- <div class="redtext" @click="savelocal('recruiting_position')">保存招聘职位</div> -->
                </template>
              </van-field>
            </div>
 
            <!-- 招聘人数  -->
            <!-- <van-field
              autocomplete="off"
              type="number"
              v-model="recruiting_numbers"
              name="recruiting_numbers"
              label="招聘人数"
              right-icon="video-o"
              @click-right-icon="rightClick"
              placeholder="请输入招聘人数(必填)"
              :rules="[{required: true, message: '未填写'}]"
              required
            ></van-field> -->
            <!-- 工作时间说明  -->
            <!-- <van-field
              autocomplete="off"
              v-model="work_days"
              name="work_days"
              label="工作时间"
              right-icon="video-o"
              @click-right-icon="rightClick"
              placeholder="请输入工作时间说明(必填)"
              type="textarea"
              rows="1"
              autosize
              :rules="[
                {required: true, message: '工作时间未填写'},
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '工作时间长度不能超过500位'
                }
              ]"
              required
            /> -->
            <!-- 休息日说明  -->
            <!-- <van-field
              autocomplete="off"
              v-model="res_days"
              name="res_days"
              label="休息时间"
              right-icon="video-o"
              @click-right-icon="rightClick"
              placeholder="请输入休息时间说明(必填)"
              type="textarea"
              rows="1"
              autosize
              :rules="[
                {required: true, message: '休息时间未填写'},
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '休息时间长度不能超过500位'
                }
              ]"
              required
            /> -->
            <!--  职位属性  -->
            <div class="greentxt">
              <van-field autocomplete="off" name="position_id" label="职位属性" v-if="positionIdList.length">
                <template #input>
                  <van-checkbox-group v-model="position_ids" direction="horizontal" style="margin-bottom: -10px">
                    <com-checkbox v-for="item in positionIdList" :key-id="item.key" prop-name="position_ids"
                      shape="square" :name="item.key" :key-name="item.value" :key="item.key" right-icon="video-o"
                      @click-right-icon="rightClick" style="margin-bottom: 10px">{{
                        item.value }}</com-checkbox>
                  </van-checkbox-group>
                </template>
              </van-field>
            </div>
            <!--  班制属性  -->
            <div class="greentxt">
              <van-field autocomplete="off" name="class_attribute_id" label="班制属性" v-if="classAttributeIdList.length">
                <template #input>
                  <van-checkbox-group v-model="class_attribute_ids" direction="horizontal" style="margin-bottom: -10px">
                    <com-checkbox shape="square" v-for="item in classAttributeIdList" prop-name="class_attribute_ids"
                      :key-id="item.key" :key-name="item.value" :name="item.key" :key="item.key"
                      style="margin-bottom: 10px">{{ item.value
                      }}</com-checkbox>
                  </van-checkbox-group>
                </template>
              </van-field>
              <van-field autocomplete="off" name="Iswithphone" label="上班是否可带手机">
                <template #input>
                  <van-checkbox-group v-model="Iswithphones" direction="horizontal" style="margin-bottom: -10px">
                    <com-checkbox v-for="item in withPhoneList" shape="square" prop-name="Iswithphones"
                      :key-id="item.key" :key-name="item.value" :key="item.key" :name="item.key"
                      style="margin-bottom: 10px">{{ item.value
                      }}</com-checkbox>
                    <!-- <van-checkbox shape="square" :name="1" style="margin-bottom: 10px">不可带</van-checkbox> -->
                  </van-checkbox-group>
                </template>
              </van-field>
              <!-- {{Iswearcleanclothess}} -->
              <van-field autocomplete="off" name="Iswearcleanclothes" label="上班是否穿无尘服">
                <template #input>
                  <van-checkbox-group v-model="Iswearcleanclothess" direction="horizontal" style="margin-bottom: -10px">
                    <com-checkbox v-for="item in wearcleanclothesList" :key-id="item.key"
                      prop-name="Iswearcleanclothess" shape="square" :key-name="item.value" :key="item.key"
                      :name="item.key" style="margin-bottom: 10px">{{ item.value
                      }}</com-checkbox>
                    <!-- <van-checkbox shape="square" :name="0" style="margin-bottom: 10px">必须穿</van-checkbox>
                    <van-checkbox shape="square" :name="1" style="margin-bottom: 10px">不穿</van-checkbox> -->
                  </van-checkbox-group>
                </template>
              </van-field>
              <van-field autocomplete="off" name="vision" label="入职是否体检">
                <template #input>
                  <van-checkbox-group v-model="visions" direction="horizontal" style="margin-bottom: -10px">
                    <com-checkbox v-for="item in visionsList" shape="square" prop-name="visions" :key-id="item.key"
                      :key-name="item.value" :key="item.key" :name="item.key" style="margin-bottom: 10px">{{ item.value
                      }}</com-checkbox>
                    <!-- <van-checkbox shape="square" :name="0" style="margin-bottom: 10px">体检</van-checkbox>
                    <van-checkbox shape="square" :name="1" style="margin-bottom: 10px">不体检</van-checkbox> -->
                  </van-checkbox-group>
                </template>
              </van-field>
            </div>
            <!-- <van-field
              autocomplete="off"
              v-model="job_content"
              name="job_content"
              label="工作内容"
              right-icon="video-o"
              @click-right-icon="rightClick"
              placeholder="请输入工作内容、岗位职责(必填)"
              type="textarea"
              rows="1"
              autosize
              :rules="[
                {required: true, message: '工作内容未填写'},
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '工作内容长度不能超过500位'
                }
              ]"
              required
            /> -->
            <!-- <van-field
              autocomplete="off"
              v-model="job_environment"
              name="job_environment"
              label="工作环境"
              right-icon="video-o"
              @click-right-icon="rightClick"
              placeholder="请输入工作环境(必填)"
              type="textarea"
              rows="1"
              autosize
              :rules="[
                {required: true, message: '工作环境未填写'},
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '工作环境长度不能超过500位'
                }
              ]"
              required
            /> -->
 
            <!-- <van-field
              autocomplete="off"
              v-model="completion_instructions"
              name="completion_instructions"
              label="旷工说明"
              right-icon="video-o"
              @click-right-icon="rightClick"
              placeholder="请输入旷工说明(必填)"
              type="textarea"
              rows="1"
              autosize
              :rules="[
                {required: true, message: '旷工说明未填写'},
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '旷工说明长度不能超过500位'
                }
              ]"
              required
            /> -->
 
            <!-- <van-field
              autocomplete="off"
              v-model="self_explanation"
              name="self_explanation"
              label="自离说明"
              right-icon="video-o"
              @click-right-icon="rightClick"
              placeholder="请输入自离说明(必填)"
              type="textarea"
              rows="1"
              autosize
              :rules="[
                {required: true, message: '自离说明未填写'},
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '自离说明长度不能超过500位'
                }
              ]"
              required
            /> -->
 
            <!-- <van-field
              autocomplete="off"
              v-model="resignation_instructions"
              name="resignation_instructions"
              label="辞职说明"
              right-icon="video-o"
              @click-right-icon="rightClick"
              placeholder="请输入辞职说明(必填)"
              type="textarea"
              rows="1"
              autosize
              :rules="[
                {required: true, message: '辞职说明未填写'},
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '辞职说明长度不能超过500位'
                }
              ]"
              required
            /> -->
 
            <!-- <van-field
              autocomplete="off"
              v-model="other_description"
              name="other_description"
              label="其他说明"
              right-icon="video-o"
              @click-right-icon="rightClick"
              placeholder="请输入其他说明"
              type="textarea"
              rows="1"
              autosize
              :rules="[
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '其它说明长度不能超过500位'
                }
              ]"
            /> -->
            <div class="greentxt">
              <van-field autocomplete="off" name="photos" label="上传图片">
                <template #input>
                  <van-uploader v-model="photos" :preview-options="{
                    closeable: true
                  }" :max-count="9" :after-read="uploadPhotoList" @delete="toDeleteAnyPreviewPhoto" :deletable="(jobDetailInfo && jobDetailInfo.status == 2) ||
                    ['publishJob', 'canShare', 'jobSheet'].includes(keyword)
                    " :show-upload="(jobDetailInfo && jobDetailInfo.status == 2) ||
                      ['publishJob', 'canShare', 'jobSheet'].includes(keyword)
                      " />
                </template>
                <template #label>
                  <div @click="openShowUploadPhoto">上传图片</div>
                </template>
              </van-field>
              <van-field autocomplete="off" name="job_videos" label="上传视频" class="videosNote">
                <template #input>
                  <van-uploader upload-text="只能上传MP4格式的视频" accept="video/*" v-model="job_videos"
                    @click-preview="previewJobVideos" :max-count="9" :after-read="uploadPhotoList_ForJobVideos"
                    @delete="toDeleteAnyPreviewPhoto_ForJobVideos" :deletable="(jobDetailInfo && jobDetailInfo.status == 2) ||
                      ['publishJob', 'canShare', 'jobSheet'].includes(keyword)
                      " :show-upload="(jobDetailInfo && jobDetailInfo.status == 2) ||
                        ['publishJob', 'canShare', 'jobSheet'].includes(keyword)
                        ">
                    <template #preview-cover>
                      <van-image width="80" height="80" :src="videoIcon" />
                    </template>
                  </van-uploader>
                </template>
 
                <template #label>
                  <div @click="openShowUploadVideo">上传视频</div>
                </template>
              </van-field>
            </div>
          </div>
        </van-tab>
        <van-tab title="薪资福利">
          <div>
            <van-divider :style="{
              color: '#020202',
              borderColor: '#DD4F42',
              padding: '10px 100px 0',
              margin: '0'
            }">薪资福利</van-divider>
 
            <!--   算薪方式  -->
            <div class="color1">
              <van-field autocomplete="off" name="pay_money_mode" label="算薪方式"
                :rules="[{ required: true, message: '未选择算薪方式' }]" required>
                <template #input>
                  <van-radio-group v-model="pay_money_mode" direction="horizontal" style="margin-bottom: -10px"
                    @change="toChangePayWayId">
                    <com-radio v-for="(item, index) in calcPayMoneys" prop-name="pay_money_mode" :key-id="item.id"
                      :key-name="item.name" :name="item.id" :key="index + 101" style="margin-bottom: 10px">{{ item.name
                      }}</com-radio>
                    <com-radio v-for="(item, index) in nocalcPayMoneys" prop-name="pay_money_mode" :key-id="item.id"
                      :key-name="item.name" :name="item.id" :key="index" style="margin-bottom: 10px">{{ item.name
                      }}</com-radio>
                  </van-radio-group>
                </template>
              </van-field>
              <template>
                <van-field autocomplete="off" type="number" v-model="pay_mode_name" name="pay_mode_name"
                  :label="payMoneyModeName[pay_money_mode]" :placeholder="`请输入${payMoneyModeName[pay_money_mode]}(必填)`"
                  v-if="pay_money_mode">
                  <template #input>
                    <div v-if="
                      pay_money_mode === '0' ||
                      pay_money_mode === '3' ||
                      pay_money_mode === '8' ||
                      pay_money_mode === '9' ||
                      pay_money_mode === '10' ||
                      pay_money_mode === '11' ||
                      pay_money_mode === '12' ||
                      pay_money_mode === '13'
                    ">
                      <van-field autocomplete="off" type="number" v-model="first_value_input" placeholder="请输入"
                        name="first_value_input" required :rules="[{ required: true, message: '未填写' }]">
                        <template #button>{{ tabRadio == 9 ? '/件' : tabRadio == 10 ? '%' : '' }}</template>
                      </van-field>
                    </div>
 
                    <div v-else>
                      <div v-if="
                        pay_money_mode === '1' ||
                        pay_money_mode === '2' ||
                        pay_money_mode === '4' ||
                        pay_money_mode === '6' ||
                        pay_money_mode === '7'
                      ">
                        <van-field autocomplete="off" type="number" v-model="first_value_input" placeholder="请输入"
                          name="first_value_input" required :rules="[{ required: true, message: '未填写' }]" />
                        <!--&plus;-->
                        <van-field autocomplete="off" type="number" v-model="second_value_input" placeholder="请输入"
                          name="second_value_input" required :rules="[{ required: true, message: '未填写' }]">
                          <template #button>{{ tabRadio == 1 ? '%' : tabRadio == 2 ? '/件' : tabRadio == 9 ? '/件' : ''
                            }}</template>
                        </van-field>
                      </div>
                      <div v-else-if="pay_money_mode === '5'">
                        <van-field autocomplete="off" type="number" v-model="first_value_input" placeholder="请输入"
                          name="first_value_input" required :rules="[{ required: true, message: '未填写' }]" />
                        <!--&plus;-->
                        <van-field autocomplete="off" type="number" v-model="second_value_input" placeholder="请输入"
                          name="second_value_input" required :rules="[{ required: true, message: '未填写' }]" />
                        <!--&plus;-->
                        <van-field autocomplete="off" type="number" v-model="third_value_input" placeholder="请输入"
                          name="third_value_input" required :rules="[{ required: true, message: '未填写' }]" />
                      </div>
                    </div>
                  </template>
                </van-field>
              </template>
              <div class="calc_salary">
                <van-field autocomplete="off" type="number" label="综合工资范围" placeholder="请输入综合工资(必填)"
                name="comprehensive_salary_range" v-if="comprehensive_salary_range">
                <template #input>
                  <div>
                    <van-field autocomplete="off" v-model="min_comprehensive_salary" placeholder="请输入综合工资最小值"
                    type="number" name="min_comprehensive_salary" />
                    <van-field autocomplete="off" type="number" v-model="max_comprehensive_salary"
                    placeholder="请输入综合工资最大值" name="max_comprehensive_salary" />
                  </div>
                </template>
                <template #label>
                  <div @click="openShowMoneyRange">综合工资范围</div>
                  </template>
                </van-field>
                <div style="position: absolute; top: 40px; left: 14px;">
                  <div v-if="
                    pay_money_mode === '0' ||
                    pay_money_mode === '3' ||
                    pay_money_mode === '8' ||
                    pay_money_mode === '9' ||
                    pay_money_mode === '10' ||
                    pay_money_mode === '11' ||
                    pay_money_mode === '12' ||
                    pay_money_mode === '13'
                  " class="calc_btn" @click="loadAutoCalc">
                    智能计算</div>
                  <div v-if="
                    pay_money_mode === '0' ||
                    pay_money_mode === '3' ||
                    pay_money_mode === '8' ||
                    pay_money_mode === '9' ||
                    pay_money_mode === '10' ||
                    pay_money_mode === '11' ||
                    pay_money_mode === '12' ||
                    pay_money_mode === '13'
                  " class="calc_btn" style="top:2.3rem" @click="openAICalc">
                    智能词库</div>
                </div>
              </div>
              <!-- :readonly="disabledjz" -->
              
            </div>
            <div class="redtext">
              <van-field style="align-items: center;" label-width="10em" autocomplete="off" v-model="lend_money_amount"
              name="lend_money_amount" type="number" placeholder="请输入每周可借支的金额">
                <template #label>
                  <div @click="openShowBorrow">
                    每周可借支的金额
                  </div>
                  <!-- <p class="redtext" @click="savelocal('lend_money_amount')"></p><br>保存可借支的金额</p> -->
                </template>
              </van-field>
            </div>
            <!-- <van-field
              autocomplete="off"
              v-model="salary_description"
              name="salary_description"
              :rules="[
                {required: true, message: '请输入薪资说明！'},
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '薪资说明长度不能超过500位'
                }
              ]"
              label="薪资说明"
              right-icon="video-o"
              @click-right-icon="rightClick"
              type="textarea"
              rows="2"
              autosize
              placeholder="请输入薪资说明(必填)"
              required
            /> -->
 
            <!--   发薪日  -->
            <div class="greentxt">
              <van-field autocomplete="off" name="payday_id" label="发薪日" v-if="paydayIdList.length">
                <template #input>
                  <van-checkbox-group v-model="payday_ids" direction="horizontal" style="margin-bottom: -10px">
                    <com-checkbox v-for="item in paydayIdList" shape="square" prop-name="payday_ids" :key-id="item.key"
                      :key-name="item.value" :name="item.key" :key="item.key" style="margin-bottom: 10px">{{ item.value
                      }}</com-checkbox>
                  </van-checkbox-group>
                </template>
              </van-field>
              <!-- <all-types-pay-day
              v-if="payday_id != '0'"
              :payday_id="payday_id"
              :payday_mode_name="payday_mode_name"
              @getPaydayModeName="toUpdatePaydayModeName"
            /> -->
              <van-field autocomplete="off" name="other_benefits" label="福利" v-if="materialList.length">
                <template #input>
                  <van-checkbox-group v-model="other_benefits" direction="horizontal" style="margin-bottom: -10px">
                    <com-checkbox v-for="item in materialList" :key-id="item.key" prop-name="other_benefits"
                      :key-name="item.value" :name="item.key" shape="square" :key="item.key"
                      style="margin-bottom: 10px">{{ item.value
                      }}</com-checkbox>
                  </van-checkbox-group>
                </template>
              </van-field>
            </div>
            <!--  包吃 -->
            <!-- <van-field
              autocomplete="off"
              right-icon="video-o"
              @click-right-icon="rightClick"
              v-model="free_food"
              name="free_food"
              label="包吃"
              placeholder="请输入包吃说明(选填)"
              type="textarea"
              rows="1"
              autosize
              :rules="[
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '包吃说明长度不能超过500位'
                }
              ]"
            /> -->
            <!-- <van-field
              autocomplete="off"
              right-icon="video-o"
              @click-right-icon="rightClick"
              v-model="provide_food"
              name="provide_food"
              label="供吃"
              placeholder="请输入供吃说明(选填)"
              type="textarea"
              rows="1"
              autosize
              :rules="[
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '供吃说明长度不能超过500位'
                }
              ]"
            /> -->
            <!-- <van-field
              autocomplete="off"
              right-icon="video-o"
              @click-right-icon="rightClick"
              v-model="food_allowance"
              name="food_allowance"
              label="饭补"
              placeholder="请输入饭补说明(选填)"
              type="textarea"
              rows="1"
              autosize
              :rules="[
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '饭补说明长度不能超过500位'
                }
              ]"
            /> -->
            <!-- <van-field
              autocomplete="off"
              right-icon="video-o"
              @click-right-icon="rightClick"
              v-model="social_security"
              name="social_security"
              label="社保"
              placeholder="请输入社保说明(选填)"
              type="textarea"
              rows="1"
              autosize
              :rules="[
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '社保说明长度不能超过500位'
                }
              ]"
            /> -->
            <!-- <van-field
              autocomplete="off"
              right-icon="video-o"
              @click-right-icon="rightClick"
              v-model="insurance"
              name="insurance"
              label="保险"
              placeholder="请输入保险说明(选填)"
              type="textarea"
              rows="1"
              autosize
              :rules="[
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '保险说明长度不能超过500位'
                }
              ]"
            /> -->
            <!-- <van-field
              autocomplete="off"
              right-icon="video-o"
              @click-right-icon="rightClick"
              v-model="encase"
              name="encase"
              label="包住"
              placeholder="请输入包住说明(选填)"
              type="textarea"
              rows="1"
              autosize
              :rules="[
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '包住说明长度不能超过500位'
                }
              ]"
            /> -->
            <!-- <van-field
              autocomplete="off"
              right-icon="video-o"
              @click-right-icon="rightClick"
              v-model="provide_lodging"
              name="provide_lodging"
              label="供住"
              placeholder="请输入供住说明(选填)"
              type="textarea"
              rows="1"
              autosize
              :rules="[
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '供住说明长度不能超过500位'
                }
              ]"
            /> -->
            <!-- <van-field
              autocomplete="off"
              v-model="housing_allowance"
              name="housing_allowance"
              label="住房补贴 / 房补"
              right-icon="video-o"
              @click-right-icon="rightClick"
              placeholder="请输入住房补贴说明(选填)"
              type="textarea"
              rows="1"
              autosize
              :rules="[
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '住房补贴说明长度不能超过500位'
                }
              ]"
            />
            <van-field
              autocomplete="off"
              v-model="housing_fund"
              name="housing_fund"
              label="住房公积金"
              right-icon="video-o"
              @click-right-icon="rightClick"
              placeholder="请输入住房公积金说明(选填)"
              type="textarea"
              rows="1"
              autosize
              :rules="[
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '住房公积金说明长度不能超过500位'
                }
              ]"
            />
            <van-field
              autocomplete="off"
              v-model="bonus"
              name="bonus"
              label="奖金"
              placeholder="请输入奖金说明(选填)"
              right-icon="video-o"
              @click-right-icon="rightClick"
              type="textarea"
              rows="1"
              autosize
              :rules="[
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '奖金说明长度不能超过500位'
                }
              ]"
            />
            <van-field
              autocomplete="off"
              v-model="communication_subsidy"
              name="communication_subsidy"
              label="通讯补助 / 话补"
              right-icon="video-o"
              @click-right-icon="rightClick"
              placeholder="请输入通讯补助说明(选填)"
              type="textarea"
              rows="1"
              autosize
              :rules="[
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '通讯补助说明长度不能超过500位'
                }
              ]"
            />
            <van-field
              autocomplete="off"
              v-model="transport_allowance"
              name="transport_allowance"
              label="交通补助 / 车补"
              right-icon="video-o"
              @click-right-icon="rightClick"
              placeholder="请输入交通补助说明(选填)"
              type="textarea"
              rows="1"
              autosize
              :rules="[
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '交通补助说明长度不能超过500位'
                }
              ]"
            /> -->
 
 
 
            <!-- <van-field
              autocomplete="off"
              v-model="other_benefits"
              name="other_benefits"
              label="其他福利"
              right-icon="video-o"
              @click-right-icon="rightClick"
              type="textarea"
              rows="1"
              autosize
              placeholder="请输入其他福利(选填)"
              :rules="[
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '其他福利长度不能超过500位'
                }
              ]"
            /> -->
            <!-- <van-field
              autocomplete="off"
              v-model="other_subsidy"
              name="other_subsidy"
              label="其他补贴"
              right-icon="video-o"
              @click-right-icon="rightClick"
              type="textarea"
              rows="1"
              autosize
              placeholder="请输入其他补贴(选填)"
              :rules="[
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '其他福利长度不能超过500位'
                }
              ]"
            /> -->
          </div>
        </van-tab>
 
        <van-tab title="录用条件">
          <div>
            <van-divider :style="{
              color: '#020202',
              borderColor: '#DD4F42',
              padding: '10px 100px 0',
              margin: '0'
            }">录用条件</van-divider>
            <!-- <van-field
              autocomplete="off"
              right-icon="video-o"
              @click-right-icon="rightClick"
              v-model="age"
              name="age"
              label="年龄"
              placeholder="请输入年龄要求, 如18(选填)"
              :rules="[
                {
                  validator: value => {
                    return wordCountLimit(value, 100)
                  },
                  message: '年龄要求长度不能超过100位'
                }
              ]"
            />
            <van-field
              autocomplete="off"
              right-icon="video-o"
              @click-right-icon="rightClick"
              v-model="height"
              name="height"
              label="身高"
              placeholder="请输入身高要求, 如170(选填)"
              :rules="[
                {
                  validator: value => {
                    return wordCountLimit(value, 100)
                  },
                  message: '身高要求长度不能超过100位'
                }
              ]"
            />
            <van-field
              autocomplete="off"
              right-icon="video-o"
              @click-right-icon="rightClick"
              v-model="vision"
              name="vision"
              label="视力"
              placeholder="请输入视力要求(选填)"
              :rules="[
                {
                  validator: value => {
                    return wordCountLimit(value, 100)
                  },
                  message: '视力要求长度不能超过100位'
                }
              ]"
            /> -->
            <van-field autocomplete="off" name="educations" label="学历(多选)" v-if="educationsList.length">
              <template #input>
                <van-checkbox-group v-model="educations" direction="horizontal" style="margin-bottom: -10px">
                  <com-checkbox v-for="item in educationsList" prop-name="educations" :key-id="item.key"
                    :key-name="item.value" :name="item.key" right-icon="video-o" @click-right-icon="rightClick"
                    shape="square" :key="item.key" style="margin-bottom: 10px">
                    <span :class="item.value == '不限' ? 'color1' : 'greentxt'">{{ item.value }}</span></com-checkbox>
                </van-checkbox-group>
              </template>
              <template #label>
                <div class="greentxt">
                  学历(多选)
                </div>
              </template>
            </van-field>
            <van-field autocomplete="off" name="working_lifes_id" label="工作经验" v-if="workinglifesIdList.length">
              <template #input>
                <van-radio-group v-model="working_lifes_id" direction="horizontal" style="margin-bottom: -10px">
                  <com-radio v-for="item in workinglifesIdList" prop-name="working_lifes_id" :key-id="item.key"
                    :key-name="item.value" :name="item.key" :key="item.key" style="margin-bottom: 10px"
                    :can-click="item.value != '不限'">
                    <span class="greentxt">{{ item.value }}</span>
                  </com-radio>
                </van-radio-group>
              </template>
 
              <template #label>
                <div class="greentxt">
                  工作经验
                </div>
              </template>
            </van-field>
            <van-field autocomplete="off" name="certificate_types" label="证件类型(多选)" v-if="certificateTypesList.length">
              <template #input>
                <van-checkbox-group v-model="certificate_types" direction="horizontal" style="margin-bottom: -10px">
                  <com-checkbox v-for="item in certificateTypesList" prop-name="certificate_types" :key-id="item.key"
                    :key-name="item.value" :name="item.key" shape="square" :key="item.key" style="margin-bottom: 10px">
                    <span :class="item.value == '身份证' ? 'color1' : 'greentxt'">{{ item.value }}</span></com-checkbox>
                </van-checkbox-group>
              </template>
              <template #label>
                <div class="greentxt">
                  证件类型(多选)
                </div>
              </template>
            </van-field>
            <!-- <van-field
              autocomplete="off"
              v-model="male_to_female_ratio"
              name="male_to_female_ratio"
              label="男女比例"
              right-icon="video-o"
              @click-right-icon="rightClick"
              placeholder="请输入(选填)"
              type="textarea"
              rows="1"
              autosize
              :rules="[
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '男女比例长度不能超过500位'
                }
              ]"
            />
            <van-field
              autocomplete="off"
              v-model="not_nationality"
              name="not_nationality"
              label="已招满的民族"
              placeholder="请输入(选填)"
              right-icon="video-o"
              @click-right-icon="rightClick"
              type="textarea"
              rows="1"
              autosize
              :rules="[
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '已招满的民族说明长度不能超过500位'
                }
              ]"
            />
            <van-field
              autocomplete="off"
              v-model="not_area"
              name="not_area"
              label="已招满的地区"
              placeholder="请输入(选填)"
              right-icon="video-o"
              @click-right-icon="rightClick"
              type="textarea"
              rows="1"
              autosize
              :rules="[
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '已招满的地区说明长度不能超过500位'
                }
              ]"
            />
            <van-field
              autocomplete="off"
              v-model="medical_examination"
              name="medical_examination"
              label="体检说明"
              right-icon="video-o"
              @click-right-icon="rightClick"
              placeholder="请输入(选填)"
              type="textarea"
              rows="1"
              autosize
              :rules="[
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '体检说明长度不能超过500位'
                }
              ]"
            />
            <van-field
              autocomplete="off"
              right-icon="video-o"
              @click-right-icon="rightClick"
              v-model="hair_style"
              name="hair_style"
              label="发型要求"
              placeholder="请输入(选填)"
              type="textarea"
              rows="1"
              autosize
              :rules="[
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '发型要求长度不能超过500位'
                }
              ]"
            />
            <van-field
              autocomplete="off"
              right-icon="video-o"
              @click-right-icon="rightClick"
              v-model="tattoo_state"
              name="tattoo_state"
              label="纹身要求"
              placeholder="请输入(选填)"
              type="textarea"
              rows="1"
              autosize
              :rules="[
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '纹身要求长度不能超过500位'
                }
              ]"
            />
            <van-field
              autocomplete="off"
              v-model="tips"
              name="tips"
              label="温馨提示"
              right-icon="video-o"
              @click-right-icon="rightClick"
              type="textarea"
              rows="1"
              autosize
              placeholder="请输入其他要求"
              :rules="[
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '温馨提示内容长度不能超过500位'
                }
              ]"
            /> -->
          </div>
        </van-tab>
        <!-- <van-tab title="入职材料">
          <div>
            <van-divider
              :style="{
                color: '#020202',
                borderColor: '#DD4F42',
                padding: '10px 100px 0',
                margin: '0'
              }"
            >入职材料</van-divider>
            <van-field
              autocomplete="off"
              type="number"
              v-model="id_card_num"
              name="id_card_num"
              label="身份证复印件数量"
              right-icon="video-o"
              @click-right-icon="rightClick"
              placeholder="请输入身份证复印件数量(选填)"
            />
            <van-field
              autocomplete="off"
              type="number"
              v-model="bank_card_num"
              name="bank_card_num"
              label="银行卡复印件数量"
              right-icon="video-o"
              @click-right-icon="rightClick"
              placeholder="请输入银行卡复印件数量(选填)"
            />
            <van-field
              autocomplete="off"
              v-model="photo_color_size_quantity"
              name="photo_color_size_quantity"
              label="照片颜色尺寸和数量"
              right-icon="video-o"
              @click-right-icon="rightClick"
              placeholder="请输入照片颜色尺寸和数量(选填)"
              type="textarea"
              rows="1"
              autosize
              :rules="[
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '照片颜色尺寸和数量说明长度不能超过500位'
                }
              ]"
            />
            <van-field
              autocomplete="off"
              v-model="personal_bags"
              name="personal_bags"
              label="随身行李"
              placeholder="请输入随身行李(选填)"
              right-icon="video-o"
              @click-right-icon="rightClick"
              type="textarea"
              rows="1"
              autosize
              :rules="[
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '随身行李说明长度不能超过500位'
                }
              ]"
            />
            <van-field
              autocomplete="off"
              v-model="medical_examinationFee"
              name="medical_examinationFee"
              label="体检费"
              right-icon="video-o"
              @click-right-icon="rightClick"
              placeholder="请输入(选填)"
              type="textarea"
              rows="1"
              autosize
              :rules="[
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '体检费说明长度不能超过500位'
                }
              ]"
            />
            <van-field
              autocomplete="off"
              v-model="other_materials"
              name="other_materials"
              label="其他材料"
              right-icon="video-o"
              @click-right-icon="rightClick"
              type="textarea"
              rows="1"
              autosize
              placeholder="请输入其他材料"
              :rules="[
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '其他材料说明长度不能超过500位'
                }
              ]"
            />
          </div>
        </van-tab> -->
        <van-tab title="定位与时间">
          <div>
            <van-divider :style="{
              color: '#020202',
              borderColor: '#DD4F42',
              padding: '10px 100px 0',
              margin: '0'
            }">定位与时间</van-divider>
            <div class="redtext">
              <van-field autocomplete="off" v-model="contact" name="contact" label="" placeholder="请输入联系人(必填)">
                <template #label>
                  <span @click="openShowContractUser">联系人</span>
                </template>
              </van-field>
            </div>
            <div class="redtext">
              <van-field autocomplete="off" v-model="phone" name="phone" label="手机号" placeholder="请输入手机号(必填)">
                <template #label>
                  <span @click="openShowContractPhone">手机号</span>
                </template>
              </van-field>
            </div>
            <div class="yellowtxt">
              <van-field autocomplete="off" style="display:flex;align-items: center;" name="addressValue"
                label="面试详细地址">
                <template #label>
                  <div @click="openShowInterviewAddress">面试详细地址</div>
                  <!-- <div class="redtext" @click="savelocal('addressValue')">保存面试地址</div> -->
                </template>
 
                <template #input>
                  <van-search v-model="addressValue" id="addressInput" placeholder="请输入面试详细地址" @search="onSearchAddress"
                    style="padding:0;width:100%" class="search_content" background="#FFF">
                  </van-search>
                </template>
              </van-field>
              <van-field autocomplete="off" style="display:flex;align-items: center;" name="addressJobValue"
                label="上班详细地址">
                <template #label>
                  <div @click="openShowJobAddress">上班详细地址</div>
                  <!-- <div class="redtext" @click="savelocal('addressJobValue')">保存上班地址</div> -->
                </template>
                <template #input>
                  <van-search v-model="addressJobValue" id="addressJobInput" placeholder="请输入上班详细地址"
                    @search="onSearchJobAddress" style="padding:0;width:100%;" class="search_content" background="#FFF">
                  </van-search>
                </template>
              </van-field>
            </div>
            <!-- <van-field
              autocomplete="off"
              right-icon="video-o"
              @click-right-icon="rightClick"
              v-model="wx_num"
              name="wx_num"
              label="微信号"
              placeholder="请输入(选填)"
              :rules="[
                {
                  validator: value => {
                    return wordCountLimit(value, 100)
                  },
                  message: '微信号长度不能超过100位'
                }
              ]"
            />
            <van-field
              autocomplete="off"
              v-model="qq_num"
              name="qq_num"
              label="QQ号"
              right-icon="video-o"
              @click-right-icon="rightClick"
              placeholder="请输入(选填)"
              :rules="[
                {
                  validator: value => {
                    return wordCountLimit(value, 100)
                  },
                  message: 'QQ号长度不能超过100位'
                }
              ]"
            /> -->
 
            <!-- 面试地址   -->
            <!-- <com-full-address
              :showFullAddressObj="showFullAddressObj_interview"
              :keyWord="'interview'"
              :frontLabel="'面试'"
              @getFullAddressValue="handNeedFullAddressValue_publish"
              @updateRegionFourName="toUpdateRegionFourName"
              @updateDetailAddress="toUpdateDetailAddress"
              :disabled="false"
              :isUpdate="true"
            ></com-full-address> -->
 
            <!-- <van-field
              autocomplete="off"
              v-model="application_time"
              name="application_time"
              label="面试 / 应聘时间"
              right-icon="video-o"
              @click-right-icon="rightClick"
              placeholder="请输入"
              type="textarea"
              rows="1"
              autosize
              :rules="[
                {required: true, message: '面试时间未填写'},
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '面试时间长度不能超过500位'
                }
              ]"
              required
            /> -->
 
            <!-- 上班地址   -->
            <!-- <com-full-address
              :showFullAddressObj="showFullAddressObj_work"
              :keyWord="'work'"
              :frontLabel="'上班'"
              @getFullAddressValue="handNeedFullAddressValue_publish"
              @updateRegionFourName="toUpdateRegionFourName"
              @updateDetailAddress="toUpdateDetailAddress"
              :disabled="false"
              :isUpdate="true"
            ></com-full-address> -->
 
            <!-- <van-field
              autocomplete="off"
              v-model="car_fare_reimbursement"
              name="car_fare_reimbursement"
              label="车费报销"
              right-icon="video-o"
              @click-right-icon="rightClick"
              placeholder="请输入(选填)"
              type="textarea"
              rows="1"
              autosize
              :rules="[
                {
                  validator: value => {
                    return wordCountLimit(value, 500)
                  },
                  message: '车费报销长度不能超过500位'
                }
              ]"
            /> -->
            <div class="color1">
              <van-field autocomplete="off" required type="number" v-model="generation_of_commission"
                name="generation_of_commission" center clearable label="代招费" placeholder="请输入代招费" right-icon="video-o"
                @click-right-icon="rightClick" :rules="[
                  { required: true, message: '请填写代招费' },
                  { message: '最多只能输入带有2位小数的正数', pattern: pattern_generation }
                ]">
                <!-- <template #extra>
 
                </template> -->
                <template #label>
                  <div @click="openShowProxyMoney">代招费</div>
                </template>
              </van-field>
              <van-field label="代招费类型">
                <template #input>
                  <van-radio-group direction="horizontal" name="fee_unit" v-model="fee_unit">
                    <com-radio v-for="(item, index) in feeUnitList" :key-id="item.id" :key-name="item.value"
                      prop-name="fee_unit" :name="item.id" :value="item.id" :key="index">{{ item.value }}</com-radio>
                  </van-radio-group>
                </template>
              </van-field>
              <van-field autocomplete="off" v-model="generation_instructions" name="generation_instructions"
                label="代招说明" right-icon="video-o" @click-right-icon="rightClick" placeholder="请输入(选填)" type="textarea"
                rows="1" autosize :rules="[
                  {
                    validator: value => {
                      return wordCountLimit(value, 500)
                    },
                    message: '代招说明长度不能超过500位'
                  }
                ]">
 
                <template #label>
                  <div @click="showProxyComment = true;">代招说明</div>
                </template>
              </van-field>
              <van-field required autocomplete="off" type="number" v-model="downstream_cooperation_fee"
                name="downstream_cooperation_fee" center clearable right-icon="video-o" @click-right-icon="rightClick"
                label="下游合作费" placeholder="请输入下游合作费" :rules="[
                  { required: true, message: '请填写代招费' },
                  { message: '最多只能输入带有2位小数的正数', pattern: pattern_generation }
                ]">
                <!-- <template #extra>
                  <select style="height: 23px;position:absolute;right:1rem;" name="fee_unit"
                    v-model="cooperation_fee_unit">
                    <option v-for="(item, index) in feeUnitList" :value="item.id" :key="index">{{ item.value }}</option>
                  </select>
                </template> -->
                <template #label>
                  <div @click="showBollowMoney = true;">下游合作费</div>
                </template>
              </van-field>
              <van-field label="下游合作费类型">
                <template #input>
                  <van-radio-group direction="horizontal" name="fee_unit" v-model="cooperation_fee_unit">
                    <com-radio v-for="(item, index) in feeUnitList" :key-id="item.id" :key-name="item.value"
                      :name="item.id" prop-name="cooperation_fee_unit" :value="item.id" :key="index">{{ item.value
                      }}</com-radio>
                  </van-radio-group>
                </template>
              </van-field>
              <van-field autocomplete="off" v-model="downstream_cooperation_fee_desc"
                name="downstream_cooperation_fee_desc" label="下游合作费说明" right-icon="video-o"
                @click-right-icon="rightClick" placeholder="请输入(选填)" type="textarea" rows="1" autosize :rules="[
                  {
                    validator: value => {
                      return wordCountLimit(value, 500)
                    },
                    message: '下游合作费说明长度不能超过500位'
                  }
                ]">
 
                <template #label>
                  <div @click="openShowBollowComment">下游合作费说明</div>
                </template>
              </van-field>
            </div>
          </div>
        </van-tab>
 
        <van-tab title="上游备注">
          <div>
            <van-divider :style="{
              color: '#020202',
              borderColor: '#DD4F42',
              padding: '10px 20px 0',
              margin: '0'
            }">上游招聘信息备注（仅自己可见）</van-divider>
            <div class="color1">
              <!-- :readonly="disabledbz" -->
              <van-field style="align-items: center;" autocomplete="off" v-model="job_notes" name="job_notes"
                right-icon="video-o" @click-right-icon="rightClick" placeholder="请输入文字备注" type="textarea" rows="3"
                autosize :rules="[
                  {
                    validator: value => {
                      return wordCountLimit(value, 500)
                    },
                    message: '文字备注不能超过500位'
                  }
                ]">
                <template #label>
                  <div @click="openShowRemark">文字备注</div>
                  <!-- <div class="redtext" @click="savelocal('job_notes')">
                    保存备注</div> -->
                </template>
              </van-field>
            </div>
            <div class="greentxt">
 
              <van-field autocomplete="off" name="job_notes_photos" label="图片备注" right-icon="video-o"
                @click-right-icon="rightClick">
 
                <template #label>
                  <span @click="openShowPhoto">图片备注</span>
                </template>
                <template #input>
                  <van-uploader v-model="job_notes_photos" :preview-options="{
                    closeable: true
                  }" :max-count="9" :after-read="uploadPhotoList_ForNote" @delete="toDeleteAnyPreviewPhoto_ForNote"
                    :deletable="(jobDetailInfo && jobDetailInfo.status == 2) ||
                      ['publishJob', 'canShare', 'jobSheet'].includes(keyword)
                      " :show-upload="(jobDetailInfo && jobDetailInfo.status == 2) ||
                        ['publishJob', 'canShare', 'jobSheet'].includes(keyword)" />
                </template>
              </van-field>
 
              <van-field autocomplete="off" name="job_notes_video" label="视频备注" right-icon="video-o"
                @click-right-icon="rightClick" class="videosNote">
 
                <template #label>
                  <span @click="openShowVideo">视频备注</span>
                </template>
                <template #input>
                  <van-uploader upload-text="只能上传MP4格式的视频" accept="video/*" v-model="job_notes_video"
                    @click-preview="previewVideos" :max-count="9" :after-read="uploadPhotoList_ForNoteVideo"
                    @delete="toDeleteAnyPreviewPhoto_ForNoteVideo" :deletable="(jobDetailInfo && jobDetailInfo.status == 2) ||
                      ['publishJob', 'canShare', 'jobSheet'].includes(keyword)
                      " :show-upload="(jobDetailInfo && jobDetailInfo.status == 2) ||
                        ['publishJob', 'canShare', 'jobSheet'].includes(keyword)">
                    <template #preview-cover>
                      <van-image width="80" height="80" :src="videoIcon" />
                    </template>
                  </van-uploader>
                </template>
              </van-field>
            </div>
 
          </div>
        </van-tab>
 
        <div style="margin: 16px">
          <van-button v-if="keyword === 'publishJob'" round block
            :type="(allUserInfo.certification_state === 2 && allUserInfo.company_certification_state === 2) ? 'info' : 'danger'"
            :native-type="submitBtnType" :loading="submitBtnLoading"
            :disabled="!(allUserInfo.certification_state === 2 && allUserInfo.company_certification_state === 2)">
            {{
              (allUserInfo.certification_state === 2 && allUserInfo.company_certification_state === 2)
                ? '提交'
                : '个人认证、企业认证还未完全通过，不允许提交！'
            }}
          </van-button>
 
          <!--   只有审核失败才能再次看到，然后修改后再次提交       -->
          <van-button v-if="auditShareStatus * 1 == 2" round block type="danger" :native-type="submitBtnType"
            :loading="submitBtnLoading">已修改，确定再次提交</van-button>
 
          <van-button v-if="keyword === 'jobSheet'" round block type="danger" :native-type="submitBtnType"
            :loading="submitBtnLoading">发布职位</van-button>
 
          <van-button v-if="keyword === 'canShare'" round block type="warning" :native-type="submitBtnType"
            :loading="submitBtnLoading">提交转发</van-button>
        </div>
      </van-form>
    </van-tabs>
 
    <van-overlay :show="showPublish">
      <div class="wrapper" @click.stop>
        <div class="block">
          <img src="../assets/img/publish.jpeg" style="width:100%;height:300px">
          <p>近聘发布招聘信息不允许附带任何表情，有类似以上表情的请删除表情再发布，避免侵犯他人知识产权。</p>
          <div @click='showPublish = false' class="close">我已阅读并了解</div>
        </div>
      </div>
    </van-overlay>
    <!-- 视频、播放预览组件   -->
    <com-video-preview></com-video-preview>
 
    <com-job-position-popup v-model="showPosition" key-name="招聘职位" prop-name="recruiting_position"
      @select-change="jobPositionSelectChange"></com-job-position-popup>
    <com-job-position-popup v-model="showBorrow" key-name="每周可借支的金额" prop-name="lend_money_amount"
      @select-change="borrowSelectChange"></com-job-position-popup>
    <com-remark-popup v-model="showInterviewAddress" key-name="面试详细地址" prop-name="addressValue"></com-remark-popup>
    <com-keyword-popup v-model="showJobAddress" key-name="上班详细地址" prop-name="addressJobValue" prop-type="text"></com-keyword-popup>
    <com-keyword-popup v-model="showRemark" key-name="文字备注" prop-name="job_notes" prop-type="text"></com-keyword-popup>
    <com-keyword-select-popup v-model="showContractUser" key-name="联系人" prop-name="contact"
      @select-change="contactSelectChange"></com-keyword-select-popup>
    <com-keyword-select-popup v-model="showContractPhone" key-name="手机号" prop-name="phone"
      @select-change="phoneSelectChange"></com-keyword-select-popup>
    <com-key-upload-popup v-model="showPhoto" key-name="图片备注" prop-name="job_notes_photos"
      prop-type="image"></com-key-upload-popup>
    <com-key-upload-popup v-model="showVideo" key-name="视频备注" prop-name="job_notes_video"
      prop-type="video"></com-key-upload-popup>
    <com-key-upload-popup v-model="showUploadPhoto" key-name="上传图片" prop-name="photos"
      prop-type="image"></com-key-upload-popup>
    <com-key-upload-popup v-model="showUploadVideo" key-name="上传视频" prop-name="job_videos"
      prop-type="video"></com-key-upload-popup>
    <com-keyword-popup v-model="showCompanyName" key-name="企业名称" prop-name="enterprise_name"
      prop-type="text"></com-keyword-popup>
    <com-keyword-popup v-model="showProxyMoney" key-name="代招费" prop-name="generation_of_commission"
      prop-type="text"></com-keyword-popup>
    <com-keyword-popup v-model="showProxyComment" key-name="代招说明" prop-type="text"
      prop-name="generation_instructions"></com-keyword-popup>
    <com-keyword-popup v-model="showBollowMoney" key-name="下游合作费" prop-type="text"
      prop-name="downstream_cooperation_fee"></com-keyword-popup>
    <com-keyword-popup v-model="showBollowComment" key-name="下游合作费说明" prop-type="text"
      prop-name="downstream_cooperation_fee_desc"></com-keyword-popup>
    <com-keyword-popup v-model="showMoneyRange" key-name="综合工资范围" prop-type="range"
      prop-name="min_comprehensive_salary|max_comprehensive_salary"></com-keyword-popup>
    <com-keyword-popup v-model="showAICalc" key-name="智能计算" prop-name="xxxx" prop-type="aicalc"></com-keyword-popup>
  </div>
</template>
 
<script>
import SalaryInfo from '@/constants/salaryinfo.js';
import KeyWords from '@/views/allTypeJobs/allTypeJobss.js';
import { videoObj } from '@/utils/videoLinkObj.js'
import Compressor from 'compressorjs'
import { Toast, Dialog } from 'vant'
import { mapGetters, mapState } from 'vuex'
import { payMoneyMode } from "@/constants/payMoneyMode"
import payMoneyModeName from '../constants/payMoneyModeName'
import classAttributeIdList from '../constants/classAttributeIdList'
import positionIdList from '../constants/positionIdList'
import paydayIdList from '../constants/paydayIdList'
import workinglifesIdList from '../constants/workinglifesIdList'
import certificateTypesList from '../constants/certificateTypesList'
import materialList from '../constants/materialList'
import educationsList from '../constants/educationsList'
import feeUnitList from '../constants/feeUnitList'
import { jobTypeArr } from '../constants/comUtils'
 
import allTypesPayDay from './allTypesPayDay'
 
import comFullAddress from './comFullAddress'
import messages from '../views/messages/messages'
import { cosUploadImg } from '@/utils/cosUpload.js'
 
import posterIMg from '../assets/1.jpeg'
import videoIcon from '../assets/videoIcon.png'
import comVideoPreview from './comVideoPreview'
import quillEditor from './quillEditor'
import comCheckbox from './comAllTypeJobs/comCheckbox.vue';
import comRadio from './comAllTypeJobs/comRadio.vue';
import comKeywordEdit from './comAllTypeJobs/comKeywordEdit.vue';
import comRemarkPopup from './comAllTypeJobs/comRemarkPopup.vue';
import comJobPositionPopup from './comAllTypeJobs/comJobPositionPopup.vue';
import comKeywordSelectPopup from './comAllTypeJobs/comKeywordSelectPopup.vue';
import comKeyUploadPopup from './comAllTypeJobs/comKeyUploadPopup.vue';
import comKeywordPopup from './comAllTypeJobs/comKeywordPopup.vue';
import loginCtrl from './comAllTypeJobs/loginType'
import IntelligentFilling from './IntelligentFilling'
 
export default {
  name: 'comAllTypeJobs',
  props: {
    jobType: Number,
    btnShow: {
      type: Boolean,
      default: false,
      // 不是必传
      required: false
    },
    jobTypeId: String,
    jobDetailInfo: Object,
    // keyword取值为: canShare（转发）、auditState（查看审核状态）、publishJob（发布职位）
    keyword: String,
    // 父job_id用于转发，自身的job_id用于提交修改。
    parentOrSelfJobId: {
      type: String,
      // 不是必传
      required: false
    },
 
    auditShareStatus: String,
  },
  components: {
    comKeywordPopup,
    comKeyUploadPopup,
    comKeywordSelectPopup,
    comJobPositionPopup,
    comRemarkPopup,
    comKeywordEdit,
    comRadio,
    comCheckbox,
    allTypesPayDay,
    comFullAddress,
    comVideoPreview,
    quillEditor
  },
 
  data() {
    return {
      showMoneyRange: false,
      showAICalc: false,
      showProxyMoney: false,
      showProxyComment: false,
      showBollowMoney: false,
      showBollowComment: false,
      //每周借资金额
      showBorrow: false,
      showUploadPhoto: false,
      showUploadVideo: false,
      visionsList: [{ key: '0', value: '体检' }, { key: '1', value: '不体检' }],
      wearcleanclothesList: [{ key: '0', value: '必须穿' }, { key: '1', value: '不穿' }],
      withPhoneList: [{ key: '0', value: '可带' }, { key: '1', value: '不可带' }],
      showCompanyName: false,
 
      showInterviewAddress: false,
      showJobAddress: false,
      //招聘职位
      showPosition: false,
      //视频
      showVideo: false,
      //图片
      showPhoto: false,
      showRemark: false,
      //显示联系人列表
      showContractUser: false,
      //显示联系电话列表
      showContractPhone: false,
      //私隐登录密码
      privateLoginPwd: '',
      //私隐登录类型
      privateLoginType: loginCtrl.getPrivateLoginType(),
      isPrivateLogin: loginCtrl.isPrivateLogin(),
      // 面试地址详细数据
      interview_address: {},
      interview_lat: '',
      interview_long: '',
      work_lat: '',
      work_long: '',
      job_category_id: '',
      // 公司的id
      jobTypeList: jobTypeArr,
      // 上班地址详细数据
      work_address: {},
      // 地址搜索自动联想以及地址搜索组件
      autoCompleteComponent: undefined,
      placeSearchComponent: undefined,
      addressValue: '',//面试详细地址
      addressJobValue: '',//上班详细地址
      tabRadio: '',
      videoIcon,
      showPublish: false,
      // 提交按钮的类型
      submitBtnType: 'submit',
      submitBtnLoading: false,
      // 定义地理位置的初始状态
      interviewRegions: {
        provinceid: '',
        provincename: '',
        cityid: '',
        cityname: '',
        areaid: '',
        areaname: '',
        streetid: '',
        streetname: '',
        villageid: '',
        villagename: '',
        address: '',
        FulleAddress: '',
        long: '',
        lat: ''
      },
      // 定义地理位置的初始状态默认
      workRegions: {
        provinceid: '',
        provincename: '',
        cityid: '',
        cityname: '',
        areaid: '',
        areaname: '',
        streetid: '',
        streetname: '',
        villageid: '',
        villagename: '',
        address: '',
        FulleAddress: '',
        long: '',
        lat: ''
      },
 
      showFullAddressObj_interview: {
        region_four_name: '',
        detail_address: ''
      },
      showFullAddressObj_work: {
        region_four_name: '',
        detail_address: ''
      },
      pattern_generation: /^[0-9]+(\.[0-9]{0,2})?$/,
      active: 0,
      /*
       * 基础信息
       */
      // 公司的id
      job_content: '',
      enterprise_name: '',
      // 招聘职位
      recruiting_position: '',
      // 招聘人数
      recruiting_numbers: '',
      // 工作时间
      work_days: '',
      // 休息日说明
      res_days: '',
      // 职位属性
      position_id: '',
      position_ids: [],
      // positionIdList: [],
      positionIdList,
      // 班制属性
      class_attribute_id: '',
      class_attribute_ids: [],
      // classAttributeIdList: [],
      classAttributeIdList,
      // job_content: '',
      job_environment: '',
      // 矿工说明
      completion_instructions: '',
      // 自离说明
      self_explanation: '',
      // 辞职说明
      resignation_instructions: '',
      other_description: '',
 
      photos: [],
      // 多个图片
      photos_list_url: [],
 
      job_videos: [],
      job_videos_url: [],
 
      /*
       * 薪资福利
       */
      // 算薪方式
      pay_money_mode: '',
      // 算薪方式的名称（底薪、纯工价、同工同酬....）
      pay_mode_name: '',
      payMoneyModeList: payMoneyMode,
      payMoneyModeName,
 
      // 第一个、第二个、第三个输入的值
      first_value_input: '',
      second_value_input: '',
      third_value_input: '',
 
      // 仅仅用于占位，数值不起任何作用
      comprehensive_salary_range: '100-200',
      // 最小综合工资
      min_comprehensive_salary: '',
      // 最大综合工资
      max_comprehensive_salary: '',
      // 综合工资范围: 如: 4000 - 5000
      comprehensive_salary: '',
      // 薪资说明
      salary_description: '',
      payday_id: '',
      payday_ids: [],
      payday_mode_name: '',
      paydayIdList,
      // paydayList: [],
 
      // 包吃
      free_food: '',
      // 供吃
      provide_food: '',
      // 饭补
      food_allowance: '',
      // 社保
      social_security: '',
      // 保险
      insurance: '',
      // 包住
      encase: '',
      // 供住
      provide_lodging: '',
      // 住房补贴(房补)
      housing_allowance: '',
      // 住房公积金
      housing_fund: '',
      // 奖金
      bonus: '',
      // 通信补助(话补)
      communication_subsidy: '',
      // 交通补助
      transport_allowance: '',
      Iswithphone: '',
      Iswithphones: [],
      Iswearcleanclothes: '',
      Iswearcleanclothess: [],
      // 其他补贴
      other_subsidy: '',
 
      /*
       * 录用条件
       */
      age: '',
      height: '',
      // 视力
      vision: '',
      visions: [],
      // 学历, 多选
      educations: [],
      // 学历列表
      educationsList,
      // 工作经验
      working_lifes_id: '',
      workinglifesIdList,
      // workinglifesIdList: [],
      // 证件类型
      certificate_types: [],
      other_benefits: [],
      certificateTypesList,
      materialList,
      male_to_female_ratio: '',
      // 已招满的民族
      not_nationality: '',
      // 已招满的地区
      not_area: '',
      // 体检说明要求
      medical_examination: '',
      // 发型要求
      hair_style: '',
      // 纹身状态
      tattoo_state: '',
      // 其他要求, 温馨提示
      tips: '',
      lend_money_amount: '',
      /*
       * 入职材料
       */
      id_card_num: '',
      bank_card_num: '',
      // 照片尺寸
      photo_color_size_quantity: '',
      // 体检费
      medical_examinationFee: '',
      personal_bags: '',
      other_materials: '',
 
      /*
       * 定位与时间
       */
      contact: '',
      phone: '',
      wx_num: '',
      qq_num: '',
 
      // 面试时间 或 应聘时间
      application_time: '',
 
      // 车费报销
      car_fare_reimbursement: '',
      // 代招说明
      generation_instructions: '',
      // 代招提成
      generation_of_commission: '',
      fee_unit: '',
      feeUnitList,
      // 下游合作费
      downstream_cooperation_fee: '',
      cooperation_fee_unit: '',
      downstream_cooperation_fee_desc: '',
 
      /*
       *
       * 招聘信息备注
       *
       * */
      job_notes: '',
      job_notes_photos: [],
      job_notes_photos_url: [],
      job_notes_video: [],
      job_notes_video_url: [],
 
 
      // 禁用有缓存的input部分
      disabledjz: false,//借支的金额
      disabledbz: false,//文字备注
    }
  },
 
  created() {
    //如果没有这句代码，select中初始化会是空白的，默认选中就无法实现
    this.fee_unit = this.feeUnitList[0].id
    this.cooperation_fee_unit = this.feeUnitList[0].id
  },
 
  mounted() {
    /*
     * 核心： 使用ref="formBox"中的getValues()方法
     *
     * */
    // console.log('实例对象-----getValues()方法', this.$refs.formFieldBox.getValues())
    // 初始化地址搜索工具
 
    this.job_category_id = this.jobTypeId;
    this.mapSearchInit()
    this.mapSearchJobInit()
    //const contactinfo = localStorage.getItem('contactinfo');
    //初始化保存数据，如果btnShow==true默认使用的是保存数据
    setTimeout(() => {
      // let type=this.btnShow?'save':'source'
      this.chDataRes('save')
    }, 1000)
    // 只有时发布时，才实时保存草稿
    if (this.keyword === 'publishJob') {
      //let obj = JSON.parse(contactinfo);
      // if (contactinfo) {
      //  this.job_notes = obj.job_notes||'';
      //  this.lend_money_amount = obj.lend_money_amount||'';
      //  this.recruiting_position= obj.recruiting_position||'';
      //  this.addressValue= obj.addressValue||'';
      //  this.addressJobValue= obj.addressJobValue||'';
      //  this.contact = obj.contact||'';
      //  this.phone = obj.phone||'';
      // }
 
      this.timerId = setInterval(() => {
        // if (contactinfo) {
        //   this.contact = obj.contact||'';
        //   this.phone = obj.phone||'';
        // }
        // todo 实现草稿箱功能  2022年4月8日23:02:48 已完成
        // 获取表单的全部值
        const values = this.$refs.formFieldBox.getValues()
        // console.log('关键字', `draft_${this.keyword}_${this.jobTypeId}`, '表单值', values)
        const formVal_draft = this._getNeedFieldVal(values)
        // console.warn('1000毫秒----不断实时执行-----拼接后的参数(后端需要的字段)----草稿值', formVal_draft)
        localStorage.setItem(`draft_${this.keyword}_${this.jobTypeId}`, JSON.stringify(formVal_draft))
      }, 1000)
    }
  },
 
  beforeDestroy() {
    // 清除循环定时器
    clearInterval(this.timerId)
  },
 
  watch: {
    // 监视
    // 谨慎使用监视, 坑太多
    jobDetailInfo: {
      deep: true,
      handler(newValue, oldVal) {
        if (newValue && JSON.stringify(newValue) != '{}') {
          // console.log('newValue', newValue)
          // 只有是审核时候， 按钮的状态才变化 deletable
          // todo 解释： 由于每个form表单项没有加上disabled、或readonly、亦或者deletable属性。则这段代码不生效。暂时保留吧
          if (this.keyword === 'auditState') {
            if (newValue.status == 2) {
              // 验证审核失败时
              this.deletable = true
              this.isUpdate = true
            } else {
              this.deletable = false
              this.isUpdate = false
            }
          }
          console.log('newValue')
          console.log(newValue)
          console.log('newValue')
          // this.interviewRegions = newValue.interview_address
          // this.workRegions = newValue.work_address
          // 此段代码不要动！！！ 这是为了渲染出Dom。
          this.min_comprehensive_salary = '233333333'
          // form表单中的值
          this.pay_money_mode = newValue.pay_way_id || newValue.payway_id
          this.enterprise_name = newValue.enterprise_name
          this.recruiting_position = newValue.recruiting_position
          this.recruiting_numbers = newValue.recruiting_numbers * 1 > 0 ? newValue.recruiting_numbers * 1 : '';
          this.work_days = newValue.work_days
          this.res_days = newValue.res_days
          this.position_ids = newValue.position_id ? newValue.position_id.split(',') : [];
          this.class_attribute_ids = newValue.class_attribute_id ? newValue.class_attribute_id.split(',') : [];
          this.job_content = newValue.job_content
          this.job_environment = newValue.job_environment
          this.completion_instructions = newValue.completion_instruction_description
          this.self_explanation = newValue.self_explanation_description
          this.resignation_instructions = newValue.resignation_instructions_description
          this.other_description = newValue.other_description
 
          // 这是由于van-uploader组件渲染时， 执行了delete方法。因此使用this.$nextTick。dom渲染完后，再执行和更新状态。
          this.$nextTick(() => {
            // 需要的图片链接地址
            this.photos = newValue.photo && newValue.photo.length
              ? newValue.photo.filter(item => Boolean(item)).map(item => ({ url: item }))
              : newValue.photos && newValue.photos.length
                ? newValue.photos.filter(item => Boolean(item)).map(item => ({ url: item })) : []
 
            this.job_notes_photos =
              (newValue.notes_photos && newValue.notes_photos.length)
                ? newValue.notes_photos.split('|').map(item => ({ url: item }))
                : []
            // 视频备注
            this.job_notes_video =
              (newValue.notes_videos && newValue.notes_videos.length)
                ? newValue.notes_videos.split('|').map(item => ({ url: item }))
                : []
            // 上传视频
            this.job_videos = newValue.videos ? newValue.videos.split('|').map(item => ({ url: item })) : [];
 
            this.first_value_input = newValue.first_value_input
            this.second_value_input = newValue.second_value_input
            this.third_value_input = newValue.third_value_input
            this.min_comprehensive_salary = newValue.min_comprehensive_salary || '';
            this.max_comprehensive_salary = newValue.max_comprehensive_salary || '';
            this.comprehensive_salary_range =
              newValue.min_comprehensive_salary + '-' + newValue.max_comprehensive_salary
          })
          // 工作环境
          this.photos_list_url = newValue.photos && newValue.photos.length ? newValue.photos : []
          // 图片备注
          this.job_notes_photos_url =
            (newValue.notes_photos && newValue.notes_photos.length) ? newValue.notes_photos.split('|') : []
          this.job_notes_video_url =
            (newValue.notes_videos && newValue.notes_videos.length) ? newValue.notes_videos.split('|') : []
 
          this.job_videos_url = newValue.videos ? newValue.videos.split('|') : []
 
 
 
          this.salary_description = newValue.salary_remark
          this.lend_money_amount = newValue.lend_money_amount
          // 发薪日
          this.payday_id = newValue.payday
          // 具体的发薪日
          this.payday_mode_name = newValue.pay_money_detail_date
 
          // 包吃
          this.free_food = newValue.free_food
          // 供吃
          this.provide_food = newValue.provide_food
          // 饭补
          this.food_allowance = newValue.food_allowance
          // 社保
          this.social_security = newValue.social_security
          // 保险
          this.insurance = newValue.insurance
          // 包住
          this.encase = newValue.encase
          // 供住
          this.provide_lodging = newValue.provide_lodging
          // 住房补贴(房补)
          this.housing_allowance = newValue.housing_allowance
          // 住房公积金
          this.housing_fund = newValue.housing_fund
          // 奖金
          this.bonus = newValue.bonus
          // 通信补助(话补)
          this.communication_subsidy = newValue.communication_subsidy
          // 交通补助
          this.transport_allowance = newValue.transport_allowance
          this.Iswithphones = newValue.Iswithphone ? newValue.Iswithphone.split(',') : [];
          this.Iswearcleanclothess = newValue.Iswearcleanclothes ? newValue.Iswearcleanclothes.split(',') : [];
          // 其他补贴
          this.other_subsidy = newValue.other_subsidy || '';
 
          this.age = newValue.age
          this.height = newValue.height
          // 视力
          this.visions = newValue.vision ? newValue.vision.split(',') : [];
          // 学历, 多选
          this.educations = newValue.educations
 
          // 工作经验
          this.working_lifes_id = newValue.working_lifes_id
 
          // 证件类型
          this.certificate_types = newValue.certificate_types || newValue.certificate_type
          // 福利
          this.other_benefits = newValue.other_benefits ? newValue.other_benefits.split(',') : [];
          this.male_to_female_ratio = newValue.male_to_female_ratio
          // 已招满的民族
          this.not_nationality = newValue.not_nationality
          // 已招满的地区
          this.not_area = newValue.not_area
          // 体检说明要求
          this.medical_examination = newValue.medical_examination
          // 发型要求
          this.hair_style = newValue.hair_style
          // 纹身状态
          this.tattoo_state = newValue.tattoo_state
          // 其他要求, 温馨提示
          this.tips = newValue.tips
 
          this.id_card_num = Boolean(newValue.id_card_num * 1) ? newValue.id_card_num * 1 : '';
          this.bank_card_num = Boolean(newValue.bank_card_num * 1) ? newValue.bank_card_num * 1 : '';
          // 照片尺寸
          this.photo_color_size_quantity = newValue.photo_color_size_quantity
          // 体检费
          this.medical_examinationFee = Boolean(newValue.medical_examination_fee * 1) ? newValue.medical_examination_fee * 1 : '';
          this.personal_bags = newValue.personal_bags
          this.other_materials = newValue.other_materials
 
          /*
           * 定位与时间
           */
          this.contact = newValue.contact
          this.phone = newValue.phone
          this.wx_num = newValue.wechat
          this.qq_num = newValue.qq
          // 面试时间 或 应聘时间
          this.application_time = newValue.application_time
          // 车费报销
          this.car_fare_reimbursement = newValue.car_fare_reimbursement
          // 代招说明
          this.generation_instructions = newValue.generation_instructions
          // 代招提成
          this.generation_of_commission = newValue.generation_of_commission
          this.fee_unit = newValue.fee_unit
          // 下游合作费
          this.downstream_cooperation_fee = newValue.downstream_cooperation_fee
          this.cooperation_fee_unit = newValue.cooperation_fee_unit
          this.downstream_cooperation_fee_desc = newValue.downstream_cooperation_fee_desc
 
          this.job_notes = newValue.job_notes
          this.addressValue = newValue.interview_address_fulle_address || newValue.interview_address.FulleAddress
          this.addressJobValue = newValue.work_address_fulle_address || newValue.work_address.FulleAddress
          // todo 对位置的数据格式进行拼接、还有照片的数据进行拼接
          // this.showFullAddressObj_interview = {
          //   region_four_name: (
          //     newValue.interview_address_province_name +
          //     newValue.interview_address_city_name +
          //     newValue.interview_address_area_name + newValue.interview_address_street_name) || (
          //     newValue.interview_address.provincename +
          //     newValue.interview_address.cityname +
          //     newValue.interview_address.areaname + newValue.interview_address.streetname) || '',
          //   detail_address: newValue.interview_address_fulle_address || newValue.interview_address.address || '',
          // }
          // this.showFullAddressObj_work = {
          //   region_four_name: (
          //     newValue.work_address_province_name +
          //     newValue.work_address_city_name +
          //     newValue.work_address_area_name + newValue.work_address_street_name) || (
          //     newValue.work_address.provincename +
          //     newValue.work_address.cityname +
          //     newValue.work_address.areaname + newValue.work_address.streetname) || '',
          //   detail_address: newValue.work_address_fulle_address || newValue.work_address.address || '',
          // }
          // 面试的地理信息
          this.interviewRegions = {
            provinceid: newValue.interview_address_province_id || newValue.interview_address.provinceid,
            provincename: newValue.interview_address_province_name || newValue.interview_address.provincename,
            cityid: newValue.interview_address_city_id || newValue.interview_address.cityid,
            cityname: newValue.interview_address_city_name || newValue.interview_address.cityname,
            areaid: newValue.interview_address_area_id || newValue.interview_address.areaid,
            areaname: newValue.interview_address_area_name || newValue.interview_address.areaname,
            streetid: newValue.interview_address_street_id || newValue.interview_address.streetid,
            streetname: newValue.interview_address_street_name || newValue.interview_address.streetname,
            villageid: '',
            villagename: '',
            address: newValue.interview_address_address || newValue.interview_address.address,
            FulleAddress: newValue.interview_address_fulle_address || newValue.interview_address.FulleAddress,
            long: newValue.interview_address_lng || newValue.interview_address.long,
            lat: newValue.interview_address_lat || newValue.interview_address.lat
          }
          // 工作的地理信息
          this.workRegions = {
            provinceid: newValue.work_address_province_id || newValue.work_address.provinceid,
            provincename: newValue.work_address_province_name || newValue.work_address.provincename,
            cityid: newValue.work_address_city_id || newValue.work_address.cityid,
            cityname: newValue.work_address_city_name || newValue.work_address.cityname,
            areaid: newValue.work_address_area_id || newValue.work_address.areaid,
            areaname: newValue.work_address_area_name || newValue.work_address.areaname,
            streetid: newValue.work_address_street_id || newValue.work_address.streetid,
            streetname: newValue.work_address_street_name || newValue.work_address.streetname,
            villageid: '',
            villagename: '',
            address: newValue.work_address_address || newValue.work_address.address,
            FulleAddress: newValue.work_address_fulle_address || newValue.work_address.FulleAddress,
            long: newValue.work_address_lng || newValue.work_address.long,
            lat: newValue.work_address_lat || newValue.work_address.lat
          }
        }
      }
    }
  },
 
  methods: {
    openAICalc() {
      if (loginCtrl.isPrivateLogin())
        this.showAICalc = true;
    },
    jobPositionSelectChange(word) {
      this.recruiting_position = word;
    },
    borrowSelectChange(word) {
      this.lend_money_amount = word;
      console.log("borrowSelectChange", this.lend_money_amount);
    },
    contactSelectChange(word) {
      //console.log("contactSelectChange", selectChange);
      this.contact = word;
      localStorage.setItem("contact_user_name", word);
      //this.showContractUser = false;
    },
    phoneSelectChange(word) {
      this.phone = word;
      localStorage.setItem("contact_user_phone", word);
      //this.showContractPhone = false;
    },
    openShowBorrow() {
      if (loginCtrl.isPrivateLogin())
        this.showBorrow = true;
    },
    openShowMoneyRange() {
      if (loginCtrl.isPrivateLogin())
        this.showMoneyRange = true;
    },
    openShowContractPhone() {
      if (loginCtrl.isPrivateLogin())
        this.showContractPhone = true;
    },
    openShowContractUser() {
      if (loginCtrl.isPrivateLogin())
        this.showContractUser = true;
    },
    openShowInterviewAddress() {
      if (loginCtrl.isPrivateLogin())
        this.showInterviewAddress = true;
    },
    openShowJobAddress() {
      if (loginCtrl.isPrivateLogin())
        this.showJobAddress = true
    },
    openShowBollowComment() {
      if (loginCtrl.isPrivateLogin())
        this.showBollowComment = true;
    },
    openShowRemark() {
      if (loginCtrl.isPrivateLogin())
        this.showRemark = true;
    },
    openShowPhoto() {
      if (loginCtrl.isPrivateLogin())
        this.showPhoto = true;
    },
    openShowVideo() {
      if (loginCtrl.isPrivateLogin())
        this.showVideo = true;
    },
    openShowProxyMoney() {
      if (loginCtrl.isPrivateLogin())
        this.showProxyMoney = true;
    },
    openShowUploadVideo() {
      if (loginCtrl.isPrivateLogin())
        this.showUploadVideo = true;
    },
    openShowUploadPhoto() {
      if (loginCtrl.isPrivateLogin())
        this.showUploadPhoto = true;
    },
    openShowCompanyName() {
      if (loginCtrl.isPrivateLogin())
        this.showCompanyName = true;
    },
    openShowPosition() {
      if (loginCtrl.isPrivateLogin())
        this.showPosition = true;
    },
    privateLogout() {
      loginCtrl.exitPrivateLogin();
      this.isPrivateLogin = false;
    },
    //私隐登录
    privateLogin() {
      if (!this.privateLoginType) {
        Toast('请选择登录类型！')
        return;
      }
      if (!this.privateLoginPwd) {
        Toast('请输入登录密码！')
        return;
      }
      var that = this;
      if (this.privateLoginType == '公库') {
        let params = {
          pwd: this.privateLoginPwd
        }
        this.$api.keyword.globalPrivateLogin(params).then(res => {
          if (res.code === 200 && res.data == true) {
            // 隐私密码正确
            loginCtrl.privateLogin(this.privateLoginType);
            that.isPrivateLogin = true;
          } else {
            Toast('隐私密码错误！')
          }
        })
      }
      else if (this.privateLoginType == '私库') {
        let params = {
          privacypwd: this.privateLoginPwd
        }
        this.$api.user.privacyCheck(params).then(res => {
          if (res.code === 200 && res.data == 'true') {
            // 隐私密码正确
            loginCtrl.privateLogin(this.privateLoginType);
            that.isPrivateLogin = true;
          } else {
            Toast('隐私密码错误！')
          }
        })
      }
    },
    //修改数据源（保存数据/源数据）
    chDataRes(type) {
      let { job_notes, lend_money_amount, recruiting_position, addressValue, addressJobValue, contact, phone } = this.jobDetailInfo
      const contactinfo = localStorage.getItem('contactinfo');
      var obj = JSON.parse(contactinfo);
      if (!obj)
        obj = {};
      if (type == 'source') {
        this.job_notes = job_notes || '';
        this.lend_money_amount = lend_money_amount || '';
        this.recruiting_position = recruiting_position || '';
        this.addressValue = addressValue || '';
        this.addressJobValue = addressJobValue || '';
        this.contact = contact || '';
        this.phone = phone || '';
      } else if (type == 'save') {
 
        if (localStorage.getItem("contact_user_name"))
          obj.contact = localStorage.getItem("contact_user_name");
        if (localStorage.getItem("contact_user_phone"))
          obj.phone = localStorage.getItem("contact_user_phone");
        this.job_notes = obj.job_notes || '';
        this.lend_money_amount = obj.lend_money_amount || '';
        this.recruiting_position = obj.recruiting_position || '';
        this.addressValue = obj.addressValue || '';
        this.addressJobValue = obj.addressJobValue || '';
        this.contact = obj.contact || '';
        this.phone = obj.phone || '';
      }
      console.log('chDataRes', type)
    },
    savelocal(field) {
      const contactinfo = localStorage.getItem('contactinfo');
      let obj = JSON.parse(contactinfo);
      localStorage.setItem("contactinfo", JSON.stringify({ ...obj, [field]: this[field] }));
      Toast('保存成功');
    },
    rightClick(e) {
      window.location.href = videoObj[e.path[4].childNodes[0].innerText]
    },
    videoIconFun() {
      console.log('fsfdasfad')
    },
    //发布富文本信息change事件
    costPlannedAmountChange(value) {
      console.log(value);
      this.job_content = value
    },
    // 校验输入内容的字长
    wordCountLimit(val, wordCount) {
      return val.length <= wordCount
    },
 
    // 封装公共的上传图片函数
    async _reqUploadPicture(picture) {
      let formData = new FormData()
      formData.append('filename', picture.file)
      // 公司认证的图片
      const img_type = 'job_environment'
      // const res = await this.$api.uploadImg.uploadPhotos(formData, img_type)
      const res = await cosUploadImg(picture.file, img_type)
      if (res.code === 200) {
        return res.data
      }
    },
 
    /** 初始化地址搜索工具 */
    mapSearchInit() {
      const self = this
      // 绑定自动提示
      AMap.plugin(['AMap.Autocomplete', 'AMap.PlaceSearch'], function () {
        var autoOptions = {
          input: 'addressInput', //值为界面上input空间id
          city: self.currentCityName
        }
        var autoCompleteComponent = new AMap.Autocomplete(autoOptions)
        // 注册监听Autocomplete选中项
        AMap.event.addListener(autoCompleteComponent, 'select', function (data) {
          console.log('注册监听Autocomplete选中项', data)
          self.addressValue = data.poi.name
 
          // 如果选择的是城市，则没有 location 数据
          if (data.poi.location) {
            self.interview_lat = data.poi.location.lat
            self.interview_long = data.poi.location.lng
            let lat = data.poi.location.lat // 纬度
            let lng = data.poi.location.lng // 经度
            //逆向地理编码
            AMap.plugin('AMap.Geocoder', function () {
              let geocoder = new AMap.Geocoder({})
              let lnglat = [lng, lat]
              geocoder.getAddress(lnglat, function (status, geoData) {
                if (status === 'complete' && geoData.info === 'OK') {
                  // result为对应的地理位置详细信息
                  console.log('获取选中地址的地理位置', geoData)
                  self.interviewRegions.FulleAddress = data.poi.name
                  self.interviewRegions.areaid = geoData.regeocode.addressComponent.adcode
                  self.interviewRegions.areaname = geoData.regeocode.addressComponent.district
                  self.interviewRegions.cityid = geoData.regeocode.addressComponent.adcode.substring(0, 4)
                  self.interviewRegions.cityname = geoData.regeocode.addressComponent.city
                  self.interviewRegions.lat = data.poi.location.lat
                  self.interviewRegions.long = data.poi.location.lng
                  self.interviewRegions.provinceid = geoData.regeocode.addressComponent.adcode.substring(0, 2)
                  self.interviewRegions.provincename = geoData.regeocode.addressComponent.province
                  self.interview_address = geoData
                  return
                }
                self.$router.push({
                  name: self.prePage,
                })
              })
            })
          } else {
            //正向地理编码
            AMap.plugin('AMap.Geocoder', function () {
              let geocoder = new AMap.Geocoder({
                // city 指定进行编码查询的城市，支持传入城市名、adcode 和 citycode
                city: '全国'
              })
 
              geocoder.getLocation(data.poi.name, function (status, geoData) {
                if (status === 'complete' && geoData.info === 'OK') {
                  // result为对应的地理位置详细信息
                  console.log('获取选中地址的地理位置', geoData)
                  self.interview_lat = geoData.geocodes[0].location.lat
                  self.interview_long = geoData.geocodes[0].location.lng
                  self.interviewRegions.FulleAddress = data.poi.name
                  self.interviewRegions.areaid = geoData.geocodes[0].adcode
                  self.interviewRegions.areaname = data.poi.district
                  self.interviewRegions.cityid = geoData.geocodes[0].addressComponent.citycode
                  self.interviewRegions.cityname = geoData.geocodes[0].addressComponent.city
                  self.interviewRegions.lat = geoData.geocodes[0].location.lat
                  self.interviewRegions.long = geoData.geocodes[0].location.lng
                  self.interviewRegions.provinceid = geoData.geocodes[0].addressComponent.citycode.substring(0, 2)
                  self.interviewRegions.provincename = geoData.geocodes[0].addressComponent.province
                  self.interview_address = geoData
                  return
                }
 
                self.$router.push({
                  name: self.prePage,
                })
              })
            })
          }
        })
 
        self.autoCompleteComponent = autoCompleteComponent
        // 注册placeSearch组件
        self.placeSearchComponent = new AMap.PlaceSearch({
          // city 指定搜索所在城市，支持传入格式有：城市名、citycode和adcode
          city: self.currentCityName,
          extensions: 'all'
        })
      })
    },
    mapSearchJobInit() {
      const self = this
      // 绑定自动提示
      AMap.plugin(['AMap.Autocomplete', 'AMap.PlaceSearch'], function () {
        var autoOptions = {
          input: 'addressJobInput', //值为界面上input空间id
          city: self.currentCityName
        }
        var autoCompleteComponent = new AMap.Autocomplete(autoOptions)
        // 注册监听Autocomplete选中项
        AMap.event.addListener(autoCompleteComponent, 'select', function (data) {
          console.log('注册监听Autocomplete选中项', data)
          self.addressJobValue = data.poi.name
 
          // 如果选择的是城市，则没有 location 数据
          if (data.poi.location) {
            self.work_lat = data.poi.location.lat
            self.work_long = data.poi.location.lng
            let lat = data.poi.location.lat // 纬度
            let lng = data.poi.location.lng // 经度
            //逆向地理编码
            AMap.plugin('AMap.Geocoder', function () {
              let geocoder = new AMap.Geocoder({})
              let lnglat = [lng, lat]
              geocoder.getAddress(lnglat, function (status, geoData) {
                if (status === 'complete' && geoData.info === 'OK') {
                  // result为对应的地理位置详细信息
                  console.log('获取选中地址的地理位置', geoData)
                  self.workRegions.FulleAddress = data.poi.name
                  self.workRegions.areaid = geoData.regeocode.addressComponent.adcode
                  self.workRegions.areaname = geoData.regeocode.addressComponent.district
                  self.workRegions.cityid = geoData.regeocode.addressComponent.adcode.substring(0, 4)
                  self.workRegions.cityname = geoData.regeocode.addressComponent.city
                  self.workRegions.lat = data.poi.location.lat
                  self.workRegions.long = data.poi.location.lng
                  self.workRegions.provinceid = geoData.regeocode.addressComponent.adcode.substring(0, 2)
                  self.workRegions.provincename = geoData.regeocode.addressComponent.province
                  self.work_address = geoData
                  return
                }
                self.$router.push({
                  name: self.prePage,
                })
              })
            })
          } else {
            //正向地理编码
            AMap.plugin('AMap.Geocoder', function () {
              let geocoder = new AMap.Geocoder({
                // city 指定进行编码查询的城市，支持传入城市名、adcode 和 citycode
                city: '全国'
              })
 
              geocoder.getLocation(data.poi.name, function (status, geoData) {
                if (status === 'complete' && geoData.info === 'OK') {
                  // result为对应的地理位置详细信息
                  console.log('获取选中地址的地理位置', geoData)
                  self.work_lat = geoData.geocodes[0].location.lat
                  self.work_long = geoData.geocodes[0].location.lng
                  self.workRegions.FulleAddress = data.poi.name
                  self.workRegions.areaid = geoData.geocodes[0].adcode
                  self.workRegions.areaname = data.poi.district
                  self.workRegions.cityid = geoData.geocodes[0].addressComponent.citycode
                  self.workRegions.cityname = geoData.geocodes[0].addressComponent.city
                  self.workRegions.lat = geoData.geocodes[0].location.lat
                  self.workRegions.long = geoData.geocodes[0].location.lng
                  self.workRegions.provinceid = geoData.geocodes[0].addressComponent.citycode.substring(0, 2)
                  self.workRegions.provincename = geoData.geocodes[0].addressComponent.province
                  self.work_address = geoData
                  return
                }
 
                self.$router.push({
                  name: self.prePage,
                })
              })
            })
          }
        })
 
        self.autoCompleteComponent = autoCompleteComponent
        // 注册placeSearch组件
        self.placeSearchComponent = new AMap.PlaceSearch({
          // city 指定搜索所在城市，支持传入格式有：城市名、citycode和adcode
          city: self.currentCityName,
          extensions: 'all'
        })
      })
    },
    /** 面试地址关键词搜索 */
    onSearchAddress() {
      console.log('addressValue', this.addressValue)
      this.placeSearchComponent.search(this.addressValue, function (status, result) {
        // 查询成功时，result即对应匹配的POI信息
        console.log(status)
        console.log(result)
      })
    },
    /** 上班地址关键词搜索 */
    onSearchJobAddress() {
      console.log('addressJobValue', this.addressJobValue)
      this.placeSearchComponent.search(this.addressJobValue, function (status, result) {
        // 查询成功时，result即对应匹配的POI信息
        console.log(status)
        console.log(result)
      })
    },
 
    // 上传图片
    uploadPhotoList(picture) {
      console.log('picture参数的file属性', picture.file)
      picture.status = 'uploading'
      picture.message = '上传中...'
      this._reqUploadPicture(picture).then(url => {
        if (!url) {
          Toast('图片上传失败!')
          picture.status = 'failed'
          picture.message = '上传失败'
        } else {
          picture.status = 'done'
        }
        picture.url = url;
        // 不断的增加
        this.photos_list_url.push(url)
      })
    },
 
    // 删除文件预览时，修改数据
    toDeleteAnyPreviewPhoto(file, detail) {
      if (this.photos_list_url.length === 0) {
        this.photos_list_url = []
      } else {
        // splice方法会改变原始数组
        this.photos_list_url.splice(detail.index, 1)
      }
    },
 
    // 上传图片
    uploadPhotoList_ForNote(picture) {
      console.log('picture参数的file属性', picture.file)
      picture.status = 'uploading'
      picture.message = '上传中...'
      this._reqUploadPicture(picture).then(url => {
        if (!url) {
          Toast('图片上传失败!')
          picture.status = 'failed'
          picture.message = '上传失败'
        } else {
          picture.status = 'done'
        }
        picture.url = url;
        // 不断的增加
        this.job_notes_photos_url.push(url)
      })
    },
 
    // 删除文件预览时，修改数据
    toDeleteAnyPreviewPhoto_ForNote(file, detail) {
      if (this.job_notes_photos_url.length === 0) {
        this.job_notes_photos_url = []
      } else {
        // splice方法会改变原始数组
        this.job_notes_photos_url.splice(detail.index, 1)
      }
    },
 
    // 上传视频
    uploadPhotoList_ForJobVideos(picture) {
      console.log('picture参数的file属性', picture.file)
      picture.status = 'uploading'
      picture.message = '上传中...'
      this._reqUploadPicture(picture).then(url => {
        if (!url) {
          Toast('图片上传失败!')
          picture.status = 'failed'
          picture.message = '上传失败'
        } else {
          picture.status = 'done'
        }
        picture.url = url;
        // 不断的增加
        this.job_videos_url.push(url)
      })
    },
 
    // 删除文件预览时，修改数据
    toDeleteAnyPreviewPhoto_ForJobVideos(file, detail) {
      if (this.job_videos_url.length === 0) {
        this.job_videos_url = []
      } else {
        // splice方法会改变原始数组
        this.job_videos_url.splice(detail.index, 1)
      }
    },
 
    previewJobVideos(file, detail) {
      console.warn(file, detail.index)
      // 跨组件通信，使用bus总线。
      this.$bus.$emit('toPreviewAndPlayVideo', file.url);//this.job_videos_url[detail.index]
    },
 
    // 上传视频
    uploadPhotoList_ForNoteVideo(picture) {
      console.log('picture参数的file属性', picture.file)
      picture.status = 'uploading'
      picture.message = '上传中...'
      this._reqUploadPicture(picture).then(url => {
        if (!url) {
          Toast('图片上传失败!')
          picture.status = 'failed'
          picture.message = '上传失败'
        } else {
          picture.status = 'done'
        }
        picture.url = url;
        // 不断的增加
        this.job_notes_video_url.push(url)
      })
    },
 
    // 删除文件预览时，修改数据
    toDeleteAnyPreviewPhoto_ForNoteVideo(file, detail) {
      if (this.job_notes_video_url.length === 0) {
        this.job_notes_video_url = []
      } else {
        // splice方法会改变原始数组
        this.job_notes_video_url.splice(detail.index, 1)
      }
    },
 
    previewVideos(file, detail) {
      console.warn(file, detail.index)
      // 跨组件通信，使用bus总线。
      this.$bus.$emit('toPreviewAndPlayVideo', file.url);//this.job_notes_video_url[detail.index]
    },
 
    toChangePayWayId(value) {
      console.log('toChangePayWayId', value)
      this.tabRadio = value
      // 每一次切换，都置空数据
      this.first_value_input = ''
      this.second_value_input = ''
      this.third_value_input = ''
    },
 
    changePayDayId(id) {
      // 每一次切换，均置空数据
      this.payday_mode_name = ''
    },
 
    toUpdatePaydayModeName(value) {
      this.payday_mode_name = value
    },
 
    handNeedFullAddressValue_publish(regions, keyWord) {
      if (keyWord === 'interview') {
        this.interviewRegions = regions
      } else {
        this.workRegions = regions
      }
    },
 
    // 修改四级地址（清空详细地址）
    toUpdateRegionFourName(newObj, keyWord) {
      if (keyWord === 'interview') {
        // 面试
        this.showFullAddressObj_interview.region_four_name = newObj.region_four_name
        this.showFullAddressObj_interview.detail_address = ''
      } else {
        // 上班
        this.showFullAddressObj_work.region_four_name = newObj.region_four_name
        this.showFullAddressObj_work.detail_address = ''
      }
    },
 
    // 修改详细地址
    toUpdateDetailAddress(newValue, keyWord) {
      if (keyWord === 'interview') {
        this.showFullAddressObj_interview.detail_address = newValue
      } else {
        this.showFullAddressObj_work.detail_address = newValue
      }
    },
 
    onFailed(errorInfo) {
      console.log('failed', errorInfo.values)
      Toast('填写的信息可能有误！请上、下滑动进行检查。')
    },
 
    // 拼接、生成后端接口所需的字段
    _getNeedFieldVal(values) {
      const {
        enterprise_name,
        recruiting_position,
        recruiting_numbers,
        work_days,
        res_days,
        position_id,
        class_attribute_id,
        job_content,
        interview_address,
        job_environment,
        completion_instructions,
        self_explanation,
        resignation_instructions,
        other_description,
        pay_money_mode,
        first_value_input,
        second_value_input,
        third_value_input,
        min_comprehensive_salary,
        max_comprehensive_salary,
        salary_description,
        lend_money_amount,
        payday_id,
        free_food,
        provide_food,
        food_allowance,
        social_security,
        insurance,
        encase,
        provide_lodging,
        housing_allowance,
        housing_fund,
        bonus,
        communication_subsidy,
        transport_allowance,
        Iswithphone,
        Iswearcleanclothes,
        other_subsidy,
        age,
        height,
        vision,
        educations,
        working_lifes_id,
        certificate_types,
        other_benefits,
        male_to_female_ratio,
        not_nationality,
        not_area,
        medical_examination,
        hair_style,
        tattoo_state,
        tips,
        id_card_num,
        bank_card_num,
        photo_color_size_quantity,
        personal_bags,
        medical_examinationFee,
        other_materials,
        contact,
        phone,
        wx_num,
        qq_num,
        application_time,
        car_fare_reimbursement,
        generation_of_commission,
        generation_instructions,
        downstream_cooperation_fee,
        downstream_cooperation_fee_desc,
        job_notes
      } = values
      const params = {
        // 转发或者发布
        job_category_id: this.jobTypeId,
 
        // 转发操作
        // parent_job_id: this.keyword === 'canShare' ? this.parentOrSelfJobId : '',
        ...(this.keyword === 'canShare' && { parent_job_id: this.parentOrSelfJobId }),
 
        // 提交修改
        // job_id: this.keyword === 'auditState' ? this.parentOrSelfJobId: '',
        ...(this.keyword === 'auditState' && { job_id: this.parentOrSelfJobId }),
 
        // 发布来源，1是收集表，0是自己填写（默认为0）
        ...(this.keyword === 'jobSheet' && { isGatherTable: '1' }),
 
        // 第一部分
        enterprise_name,
        recruiting_position,
        recruiting_numbers,
        work_days,
        res_days,
        position_id: this.position_ids.join(','),
        class_attribute_id: this.class_attribute_ids.join(','),
        job_content: this.job_content,
        job_environment,
        completion_instructions,
        self_explanation,
        resignation_instructions,
        other_description,
        // 上传图片
        photo: this.photos_list_url.filter(item => Boolean(item)),
        videos: this.job_videos_url.filter(item => Boolean(item)).join('|'),
 
        // 第二部分
        pay_way_id: pay_money_mode,
        first_value_input,
        second_value_input: second_value_input ? second_value_input : '',
        third_value_input: third_value_input ? third_value_input : '',
        min_comprehensive_salary,
        max_comprehensive_salary,
        // 薪资说明
        salary_remark: salary_description,
        // 可借支金额
        lend_money_amount: lend_money_amount || '',
 
        // 发薪方式
        payday: this.payday_ids.join(','),
        // 具体的发薪日
        pay_money_detail_date: payday_id === '0' ? '' : this.payday_mode_name,
 
        // 包吃
        free_food,
        // 供吃
        provide_food,
        // 饭补
        food_allowance,
        // 社保
        social_security,
        // 保险
        insurance,
        // 包住
        encase,
        // 供住
        provide_lodging,
        // 住房补贴
        housing_allowance,
        // 住房公积金
        housing_fund,
        // 奖金
        bonus,
        // 通讯补助
        communication_subsidy,
        // 交通补助
        transport_allowance,
        // 是否可带手机: 默认
        Iswithphone: this.Iswithphones.join(','),
        // 是否穿无尘服: 默认
        Iswearcleanclothes: this.Iswearcleanclothess.join(','),
        // 其他补贴
        other_subsidy: other_subsidy,
 
        // 第三部分
        age,
        height,
        vision: this.visions.join(','),
        educations: educations.filter(item => Boolean(item + '')),
        working_lifes_id,
        certificate_types: certificate_types.filter(item => Boolean(item + '')),
        other_benefits: this.other_benefits.join(','),
        male_to_female_ratio,
        // 招满的民族
        not_nationality,
        // 招满的区域
        not_area,
        medical_examination,
        hair_style,
        tattoo_state,
        tips,
 
        // 第四部分
        id_card_num,
        bank_card_num,
        photo_color_size_quantity,
        // 随身行李
        personal_bags,
        //  体检费
        medical_examinationFee,
        other_materials,
 
        // 第五部分
        contact,
        phone: phone,
        QQ: qq_num,
        WeChat: wx_num,
        interview_address: this.interviewRegions,
        // 面试时间
        application_time,
        work_address: this.workRegions,
        // 车费报销
        car_fare_reimbursement,
        generation_of_commission,
        // 代招费单位
        fee_unit: this.fee_unit,
        generation_instructions,
        // 下游合作费
        downstream_cooperation_fee,
        // 下游合作费的单位
        cooperation_fee_unit: this.cooperation_fee_unit,
        // 下游合作费说明
        downstream_cooperation_fee_desc,
 
        /*
         * 第五部分：备注
         * */
        job_notes,
        notes_photos: this.job_notes_photos_url.join(','),
        notes_videos: this.job_notes_video_url.join(',')
      }
 
      // 拼接所需要的字段进行返回即可。
      return params
    },
 
    onSubmit(values) {
      let self = this
      // console.log('可借支金额为: ')
      if (values.min_comprehensive_salary * 1 &&
        values.max_comprehensive_salary * 1 &&
        (values.min_comprehensive_salary * 1 >= values.max_comprehensive_salary * 1)
      ) {
        Toast('最小、最大综合工资填写不正确。或者最小综合工资不能大于最大综合工资！请修改')
      } else {
        console.log(self._getNeedFieldVal(values), 'self._getNeedFieldVal(values);')
        if (+self.allUserInfo.user_status !== 0) {
          // !个人账户异常接口
          Dialog.confirm({
            title: '账户异常',
            message: self.allUserInfo.user_status_desc || '当前账户异常',
            messageAlign: 'left',
            confirmButtonText: '请联系客服'
          })
            .then(() => {
              // this.$router.push('/customerService')
            })
            .catch(() => {
              // on cancel
            })
        } else {
 
          // 将按钮置为非提交按钮
          self.submitBtnType = 'button';
          self.submitBtnLoading = true
          self.timeNum = setTimeout(() => {
            self.submitBtnType = 'submit'
            self.submitBtnLoading = false
            clearTimeout(self.timeNum)
          }, 3000)
 
          const paramObj = self._getNeedFieldVal(values);
          console.log(self.interview_address)
          console.log(self.work_address)
          if (self.interview_address.info == "OK") {
            if (self.interview_address.regeocode) {//面试区
              let addressComponent = self.interview_address.regeocode.addressComponent
              paramObj.interview_address.FulleAddress = self.addressValue
              paramObj.interview_address.areaid = addressComponent.adcode
              paramObj.interview_address.areaname = addressComponent.district
              paramObj.interview_address.cityid = addressComponent.adcode.substring(0, 4)
              paramObj.interview_address.cityname = addressComponent.city
              paramObj.interview_address.lat = self.interview_lat
              paramObj.interview_address.long = self.interview_long
              paramObj.interview_address.provinceid = addressComponent.adcode.substring(0, 2)
              paramObj.interview_address.provincename = addressComponent.province
            }
            if (self.interview_address.geocodes) {//面试市
              let addressComponent = self.interview_address.geocodes[0].addressComponent
              paramObj.interview_address.FulleAddress = self.addressValue
              paramObj.interview_address.areaid = self.interview_address.geocodes[0].adcode
              paramObj.interview_address.areaname = addressComponent.district
              paramObj.interview_address.cityid = addressComponent.citycode
              paramObj.interview_address.cityname = addressComponent.city
              paramObj.interview_address.lat = self.interview_lat
              paramObj.interview_address.long = self.interview_long
              // paramObj.interview_address.provinceid = self.interview_address.geocodes[0].adcode.substring(0,2)
              paramObj.interview_address.provincename = addressComponent.province
            }
            if (self.work_address.regeocode) {//上班区
              let addressWorkComponent = self.work_address.regeocode.addressComponent
              paramObj.work_address.FulleAddress = self.addressJobValue
              paramObj.work_address.areaid = addressWorkComponent.adcode
              paramObj.work_address.areaname = addressWorkComponent.district
              paramObj.work_address.cityid = addressWorkComponent.adcode.substring(0, 4)
              paramObj.work_address.cityname = addressWorkComponent.city
              paramObj.work_address.lat = self.work_lat
              paramObj.work_address.long = self.work_long
              paramObj.work_address.provinceid = addressWorkComponent.adcode.substring(0, 2)
              paramObj.work_address.provincename = addressWorkComponent.provinces
            }
            if (self.work_address.geocodes) {//上班市
              let addressWorkComponent = self.work_address.geocodes[0].addressComponent
              paramObj.work_address.FulleAddress = self.addressJobValue
              paramObj.work_address.areaid = addressWorkComponent.adcode
              paramObj.work_address.areaname = addressWorkComponent.district
              paramObj.work_address.cityid = addressWorkComponent.citycode
              paramObj.work_address.cityname = addressWorkComponent.city
              paramObj.work_address.lat = self.work_lat
              paramObj.work_address.long = self.work_long
              // paramObj.work_address.provinceid = addressWorkComponent.adcode.substring(0,2)
              paramObj.work_address.provincename = addressWorkComponent.provinces
            }
            self.$emit('getJobContent', paramObj)
          } else {
            paramObj.interview_address.FulleAddress = self.interviewRegions.FulleAddress
            paramObj.interview_address.areaid = self.interviewRegions.areaid
            paramObj.interview_address.areaname = self.interviewRegions.areaname
            paramObj.interview_address.cityid = self.interviewRegions.cityid //
            paramObj.interview_address.cityname = self.interviewRegions.cityname
            paramObj.interview_address.lat = self.interviewRegions.lat
            paramObj.interview_address.long = self.interviewRegions.long
            paramObj.interview_address.provinceid = self.interviewRegions.provinceid //
            paramObj.interview_address.provincename = self.interviewRegions.provincename
 
            paramObj.work_address.FulleAddress = self.workRegions.FulleAddress
            paramObj.work_address.areaid = self.workRegions.areaid
            paramObj.work_address.areaname = self.workRegions.areaname
            paramObj.work_address.cityid = self.workRegions.cityid //
            paramObj.work_address.cityname = self.workRegions.cityname
            paramObj.work_address.lat = self.workRegions.lat
            paramObj.work_address.long = self.workRegions.long
            paramObj.work_address.provinceid = self.workRegions.provinceid //
            paramObj.work_address.provincename = self.workRegions.provincename
            console.log(paramObj, 'paramobj')
            self.$emit('getJobContent', paramObj)
          }
 
        }
      }
    },
    setNoYesStatus(data, m, notext, yestext) {
      var _this = this;
      _this[m.propName] = [];
      var noKey = m.keys.find(x => x.keyName == notext);
      var yesKey = m.keys.find(x => x.keyName == yestext);
      if (noKey) {
        var find = noKey.keywords.find(n => data.includes(n.keyword))
        if (find)
          _this[m.propName].push(noKey.keyId);
        else {
          if (noKey.defaultChecked)
            _this[m.propName].push(noKey.keyId);
          if (yesKey) {
            find = yesKey.keywords.find(n => data.includes(n.keyword))
            if (find)
              _this[m.propName].push(yesKey.keyId);
            else {
              if (yesKey.defaultChecked)
                _this[m.propName].push(yesKey.keyId);
            }
          }
        }
      } else {
        if (yesKey) {
          var find = yesKey.keywords.find(n => data.includes(n.keyword))
          if (find)
            _this[m.propName].push(yesKey.keyId);
          else {
            if (yesKey.defaultChecked)
              _this[m.propName].push(yesKey.keyId);
          }
        }
      }
    },
    getCalcProp(m, data, text, hasRange) {
      var _this = this;
      var f = m.keys.find(n => n.keyName == text && n.keywords.find(x => data.includes(x.keyword)))
      if (f) {
        var ff = f.keywords.find(n => data.includes(n.keyword));
        if (ff) {
          _this[m.propName] = ff.keyId;
          _this.$nextTick(() => {
            _this.first_value_input = _this.processSpecialNumber(ff.keyword.replace(/[^\d]/g, ""))//parseInt(ff.keyword) + '';
            if (!hasRange)
              _this.fill_salary_handle();
          })
          console.log("_this.first_value_input", ff.keyName, _this.first_value_input)
          return true
        }
      }
      return false
    },
    //
    processSpecialNumber(txt) {
      // "0️⃣1️⃣2️⃣3️⃣4️⃣5️⃣6️⃣7️⃣8️⃣9️⃣🔟".split('').filter(m=>m!="️"&&m!="⃣").forEach((item, index) => {
      //   txt = txt.replaceAll(item, index + '');
      // });
      return txt;
    },
    loadAutoCalc() {
      var that = this;
      this.$api.keyword.getKeywords({}).then(res => {
        var aicalc = res.data.item1.find(m => m.propType == 'aicalc');
        if (aicalc) {
          var ary = [];
          aicalc.keys.forEach(k => {
            k.keywords.forEach(w => {
              var ary1 = w.keyword.split('-');
              if (ary1.length >= 4)
                ary.push({ keyName: ary1[0], id: parseInt(ary1[1]), min: parseInt(ary1[2]), max: parseInt(ary1[3]) });
            });
          })
          SalaryInfo.calc_rules = ary;
          that.fill_salary_handle();
          //console.log("_this.SalaryInfo.calc_rules", SalaryInfo.calc_rules)
 
        }
      })
    },
    autofill_handle(data) {
      this.pay_money_mode = this.lend_money_amount = this.recruiting_position = this.contact = this.job_notes = this.phone = this.enterprise_name = this.downstream_cooperation_fee_desc = this.downstream_cooperation_fee = this.addressValue = this.addressJobValue = this.generation_of_commission = this.generation_instructions = '';
      this.photos = this.job_notes_photos = this.job_notes_video = this.job_videos = [];
      this.job_videos_url = this.photos_list_url = this.job_notes_video_url = this.job_notes_photos_url = [];
      this.$api.keyword.getKeywords({}).then(res => {
        IntelligentFilling.fill(this, data, res.data.item1)
        this.job_content = IntelligentFilling.del(data, res.data.item2)
        // 薪资范围未匹配出，使用智能计算
        if (!(this.min_comprehensive_salary * 1 + this.max_comprehensive_salary * 1)) {
          this.$nextTick(() => {
            this.fill_salary_handle();
          })
        }
        Toast('已完成智能填写!');
      });
    },
    fill_contact_handle() {
      console.log(data);
      this.contact = data.contact || '';
      this.phone = data.phone || '';
    },
    fill_salary_handle() {
      // if (!isNotOpen) {
      //   if (loginCtrl.isPrivateLogin())
      //     this.showAICalc = true;
      // }
      console.log("fill_salary_handle")
 
      let val = this.first_value_input;
      if (!(val * 1)) {
        return
      }
      let f = SalaryInfo.calc_rules.find(t => t.id == val && t.keyName == this.payMoneyModeName[this.pay_money_mode]);
      if (f) {
        this.min_comprehensive_salary = f.min;
        this.max_comprehensive_salary = f.max;
      } else {
        this.min_comprehensive_salary = '';
        this.max_comprehensive_salary = '';
      }
    }
  },
 
  computed: {
    ...mapGetters(['allUserInfo']),
    calcPayMoneys() {
      return payMoneyMode.filter(i => i.id === '3' || i.id === '8');
    },
    nocalcPayMoneys() {
      return payMoneyMode.filter(i => i.id !== '3' && i.id !== '8');
    }
  }
}
</script>
 
<style lang="scss" scoped>
.com_comAllTypeJobs {
  width: 100%;
  position: relative;
 
  .videosNote {
    /deep/ .van-ellipsis {
      display: none;
    }
  }
}
 
.wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
 
.block {
  width: 300px;
  text-align: center;
  // height: 120px;
  padding-bottom: 20px;
  background-color: #fff;
 
  p {
    color: red;
    font-size: 16px;
    padding: 5px;
  }
 
  .close {
    width: 150px;
    margin: 0 auto;
    text-align: center;
    height: 30px;
    line-height: 30px;
    border: 1px solid #1989fa;
    color: #1989fa;
  }
}
 
p.redtext {
  color: red;
}
 
.redtext::v-deep .van-field__label,
.redtext::v-deep .van-field__control {
  color: red;
}
 
.redtext::v-deep .van-icon.van-icon-search {
  color: red !important
}
 
// .greentxt::v-deep .van-radio__label {
//   color: green;
// }
 
.calc_salary {
  position: relative;
}
 
.calc_salary .calc_btn {
  color: #cbcb06;
  font-size: 0.38rem;
  z-index: 90;
}
 
.color1,
.color1::v-deep .van-field__label,
.color1::v-deep .van-radio__label,
.color1::v-deep .van-field__control {
  color: #ff00ff;
}
 
 
.greentxt,
.greentxt::v-deep .van-field__label,
.greentxt::v-deep .van-radio__label,
.greentxt::v-deep .van-checkbox__label,
.greentxt::v-deep .van-field__control {
  color: green;
}
 
.yellowtxt,
.yellowtxt::v-deep .van-field__label,
.yellowtxt::v-deep .van-radio__label,
.yellowtxt::v-deep .van-checkbox__label,
.yellowtxt::v-deep .van-field__control {
  color: #cbcb06;
}
</style>